Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
"Bob Phillips" wrote in
: Bob, Using; For RowCount = 3 To Selection.Rows.Count ' Start at Row 3 I can loop through selected Rows - Can I just loop through ALL the Rows that exist (starting at Row 3) ? so the user does not have to select the rows first ? Thanks PS - I think I have found that Cells.(x,y) seems to reference individual cells as per my last question ? Is this the best way. Thanks again |
#2
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Your use of Cells(x,y) is as good a way as any.
As for working through rows without the user having to select them all first, you can do that also. First step is to determine a column that will always have some entry in a cell in it in the last used row. For this example we'll assume it is column B. Then you can use this as your FOR statement: For RowCount = 3 To _ Range("B" & Rows.Count).End(xlUp).Row "Isis" wrote: "Bob Phillips" wrote in : Bob, Using; For RowCount = 3 To Selection.Rows.Count ' Start at Row 3 I can loop through selected Rows - Can I just loop through ALL the Rows that exist (starting at Row 3) ? so the user does not have to select the rows first ? Thanks PS - I think I have found that Cells.(x,y) seems to reference individual cells as per my last question ? Is this the best way. Thanks again |
#3
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
?B?SkxhdGhhbQ==?= <HelpFrom @ Jlathamsite.com.(removethis) wrote in
: For RowCount = 3 To _ Range("B" & Rows.Count).End(xlUp).Row Not quite sure whom I am thanking, but Thank You - that seems to work. Could I also have used SpecialCells somehow - just asking out of interest. Thanks |
#4
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
I think the thanks should go to Bob, he provided the meat of the solution
while I just gave you one minor change. You might or might not be able to use one of the SpecialCells, but that's iffy at times depending the worksheet. The way I provided is a 'sure thing' although if row 3 is empty in that column and nothing below it in the column, then you will get an error when it attempts to execute. "Isis" wrote: ?B?SkxhdGhhbQ==?= <HelpFrom @ Jlathamsite.com.(removethis) wrote in : For RowCount = 3 To _ Range("B" & Rows.Count).End(xlUp).Row Not quite sure whom I am thanking, but Thank You - that seems to work. Could I also have used SpecialCells somehow - just asking out of interest. Thanks |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|