Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
How can I make this to stop at the last used row? It goes to the row 65536
Sub FillDownByColumn() Do Until y = Range("A1").CurrentRegion.Rows.Count - 1 Selection.End(xlDown).Activate Range(Selection, Selection.End(xlDown).Offset(-1, 0)).Select Selection.FillDown y = Selection.Row Loop End Sub Thanks in advance |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Have you single-stepped through your code to watch it at work?
Range(Selection, Selection.End(xlDown).Offset(-1, 0)).Select ... selects the last cell in Column $A down to the last cell on row 655,535 on the first pass through the loop, then fills it with data. Do Until y = Range("A1").CurrentRegion.Rows.Count - 1 ....then has a CurrentRegion of the entire worksheet on the very next loop, which becomes endless!!! -- Regards, Bill Renaud |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Thanks Bill,
Yes I have single-stepped through the code. I'm working with a range with several non-continuos blanks. Whay it does is to select the cell at the top and blanks below and fill them. Then it moves to the next cell with blanks underneath and so on. It is identiying the last row of the range correctly, not 65536. It just doesn't stop at it. Do you have any other approach? Thanks "Bill Renaud" wrote: Have you single-stepped through your code to watch it at work? Range(Selection, Selection.End(xlDown).Offset(-1, 0)).Select ... selects the last cell in Column $A down to the last cell on row 655,535 on the first pass through the loop, then fills it with data. Do Until y = Range("A1").CurrentRegion.Rows.Count - 1 ....then has a CurrentRegion of the entire worksheet on the very next loop, which becomes endless!!! -- Regards, Bill Renaud |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
OK, so if you have the following data, show us what you want to happen
(copy the table below, then fill in the blank cells): A B C 1 123 456 789 2 234 567 897 3 234 345 4 234 545 5 234 456 456 6 123 456 789 7 234 567 8 9 234 -- Regards, Bill Renaud |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I got it figuere it out.
I wasn't referring to the variable withing the loop. Thanks "Bill Renaud" wrote: OK, so if you have the following data, show us what you want to happen (copy the table below, then fill in the blank cells): A B C 1 123 456 789 2 234 567 897 3 234 345 4 234 545 5 234 456 456 6 123 456 789 7 234 567 8 9 234 -- Regards, Bill Renaud |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
in Save As,how to stop auto fill in whatever the mouse hovers on? | Setting up and Configuration of Excel | |||
Stop Overwriting (Fill, Copy, etc) Data Validation | Excel Discussion (Misc queries) | |||
How do I stop Excel from progressing a formula in fill down or rig | Excel Worksheet Functions | |||
stop auto fill from thinking for itself!!!!!!! | New Users to Excel | |||
How do I stop other circles in other boxes to stop selecting? | Excel Worksheet Functions |