# Thread: Some help with selecting cells (XP)

1. ## Some help with selecting cells (XP)

I've got a problem analysing a set of data. I have a spreadsheet with A-X columns and approx. 500 rows.

I need to be able to separate the data into two worksheets based on the values in column N and R which contain difference values.

What I need to do is find out which of the columns N and R is the smaller (Absolute value) and then copy that row to worksheet One if N is the smaller and to worksheet TWO if R is the smaller

Any help would really be appreciated as I am still very much a beginner with macros.

Thanks in anticipation

John

2. ## Re: Some help with selecting cells (XP)

First: add column Y of consecutive integers:: enter 1 in Y1, then double-click the black square in the lower-right corner of X1, then change the auto-fill options at the bottom of the colum to fill series.
Second: enter the formula =IF(ABS(N1)<ABS(R1),0,1) in cell Y1, then double-click the black square in the lower-right corner of Y1.
Third: sort the data using column Y as the key
Fourth: move the rows with ones in column Y to another sheet, sort the data on column X, and delete columns X & Y.
Repeat above step for the zeros.
HTH --Sam

3. ## Re: Some help with selecting cells (XP)

Thanks Sam. There I was looking for the difficult solution and you came up with a very simple solution. A lesson for me.

The only thing was that I'm not sure whether I misread your instructions but I changed the formual slightly to =IF(ABS(N1)<ABS(R1)>0,0,1) as I was getting all 0s initially.

Thanks again

John

#### Posting Permissions

• You may not post new threads
• You may not post replies
• You may not post attachments
• You may not edit your posts
•