Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I have an Excel 2000 spreadsheet where C1 and D1 have
headings. Column C has contiguous data but the number of data rows changes. Sometimes it is 300, sometimes 322 and at yet others 600. (That is, C1:C601 has data). If C1:C601 have data, I would like to select D2:D601. In other words, I would like the starting point to be D2 and the end point to depend on how much data C contains. If someone can show me how to do this it would be greatly appreciated. If someone could show me how to select data based on the previous column (rather than limit it to C and D)that would be even more helpful. Thank you. --Indu |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
See if this helps
Sub myarea() x = Cells(Rows.Count, "c").End(xlUp).Row Range(Cells(2, "d"), Cells(x, "d")).Select End Sub -- Don Guillett SalesAid Software "Indu Aronson" wrote in message ... I have an Excel 2000 spreadsheet where C1 and D1 have headings. Column C has contiguous data but the number of data rows changes. Sometimes it is 300, sometimes 322 and at yet others 600. (That is, C1:C601 has data). If C1:C601 have data, I would like to select D2:D601. In other words, I would like the starting point to be D2 and the end point to depend on how much data C contains. If someone can show me how to do this it would be greatly appreciated. If someone could show me how to select data based on the previous column (rather than limit it to C and D)that would be even more helpful. Thank you. --Indu |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Don and Nikos thank you very much for your help. Both
versions work just the way I wanted it to. Thanks again. -----Original Message----- See if this helps Sub myarea() x = Cells(Rows.Count, "c").End(xlUp).Row Range(Cells(2, "d"), Cells(x, "d")).Select End Sub -- Don Guillett SalesAid Software "Indu Aronson" wrote in message ... I have an Excel 2000 spreadsheet where C1 and D1 have headings. Column C has contiguous data but the number of data rows changes. Sometimes it is 300, sometimes 322 and at yet others 600. (That is, C1:C601 has data). If C1:C601 have data, I would like to select D2:D601. In other words, I would like the starting point to be D2 and the end point to depend on how much data C contains. If someone can show me how to do this it would be greatly appreciated. If someone could show me how to select data based on the previous column (rather than limit it to C and D)that would be even more helpful. Thank you. --Indu . |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Try this piece of code:
Range("C2").Select Range(Selection, Selection.End(xlDown)).Select Selection.Offset(0,1).Select Nikos -----Original Message----- I have an Excel 2000 spreadsheet where C1 and D1 have headings. Column C has contiguous data but the number of data rows changes. Sometimes it is 300, sometimes 322 and at yet others 600. (That is, C1:C601 has data). If C1:C601 have data, I would like to select D2:D601. In other words, I would like the starting point to be D2 and the end point to depend on how much data C contains. If someone can show me how to do this it would be greatly appreciated. If someone could show me how to select data based on the previous column (rather than limit it to C and D)that would be even more helpful. Thank you. --Indu . |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
selecting a range | Excel Discussion (Misc queries) | |||
Please help with selecting a range | Excel Discussion (Misc queries) | |||
Selecting range in list of range names depending on a cell informa | Excel Discussion (Misc queries) | |||
Selecting a Range | Excel Programming | |||
Help with selecting a range... | Excel Programming |