Results 1 to 3 of 3
  1. #1
    New Lounger
    Join Date
    Dec 2004
    Location
    Adelaide, South Australia, Australia
    Posts
    15
    Thanks
    0
    Thanked 0 Times in 0 Posts

    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. #2
    Silver Lounger
    Join Date
    Mar 2001
    Location
    Springfield, Ohio, USA
    Posts
    2,136
    Thanks
    0
    Thanked 1 Time in 1 Post

    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
    <font face="Comic Sans MS">Sam Barrett, CACI </font face=comic>
    <small>And the things that you have heard... commit these to faithful men who will be able to teach others also. 2 Timothy 2:2</small>

  3. #3
    New Lounger
    Join Date
    Dec 2004
    Location
    Adelaide, South Australia, Australia
    Posts
    15
    Thanks
    0
    Thanked 0 Times in 0 Posts

    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
  •