Home |
Search |
Today's Posts |
#6
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Just some thoughts:
I don't see where the heading is copied as specified by the OP. Might want to change Sheets("Sheet2").Range("a2:h" & m).Copy ActiveSheet.Range("A2") to Sheets("Sheet2").Range("a1:h" & m).Copy ActiveSheet.Range("A1") IF he is looking for 32 and it isn't found in the data it would cause an error? The error isn't handled gracefully and would just puke all over the screen. If he has option explict at the top of the module, your code gives me an error. Several in fact. (same with mine). Sub testIt() Dim n as Long Dim m as Long Dim rng as Range n = 100 Set rng = Sheets("Sheet2").Range("a2:H" & n).Find(32) if not rng is nothing then m = rng.Row Worksheets.Add Sheets("Sheet2").Range("a1:h" & m).Copy ActiveSheet.Range("A1") End if End Sub -- Regards, Tom Ogilvy "Alan Beban" wrote in message ... I assumed your data is in A2:H100, and that you were looking for 32 in Column 2: Sub testIt() n = 100 Set rng = Sheets("Sheet2").Range("a2:H" & n) m = rng.Columns(2).Find(32).Row Worksheets.Add Sheets("Sheet2").Range("a2:h" & m).Copy ActiveSheet.Range("A2") End Sub Alan Beban Chuck Mryglot wrote: Hi Alan. I have 8 columns of data...with a heading at the top of each column...e.g. row 1 is headings and data starts in row 2. The data is sorted. I need to look down one of the columns until I find a particular integer value. Then I need to copy everything from row 2 down to the row in which I found the integer I was looking for....call it row n .....and past the 8 columns (with headings) from row 1 to row m onto a new sheet. chuck *** Sent via Developersdex http://www.developersdex.com *** Don't just participate in USENET...get rewarded for it! |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Array formula: how to join 2 ranges together to form one array? | Excel Worksheet Functions | |||
Finding duplicates in distinct ranges... | Excel Worksheet Functions | |||
Finding specific text in ranges | Excel Discussion (Misc queries) | |||
Finding max from different ranges of data | Excel Discussion (Misc queries) | |||
variant array containing cel adresses convert to actual ranges-array | Excel Programming |