Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Go to the next blank row in a column (xlDown)
Does anyone know of a way to have excel go to the next blank row in a column?
I currently use XlDown but this only takes me to the last row with values. This causes my macro to overwrite the last row's data and is a significant problem for me. I've used the following suggestions: 1. .End(xlDown).Offset(1,0) Problem: I get a compile error that says "expected = " So then I do, .End(xlDown).Offset = 0 or .End(xlDown).Offset = 1 because this is the only way that does not cause a compile error that I've found. However the problem remains. Excel will go to the last row with values and replace the cell with either (1) or (0). 2. I've also tried: dim rng as range set rng = sheets("Sheet1").Range("A65536").end(xlUp).offset( 1,0) Problem: Same problem as the other. Please tell me what I'm doing wrong or if there is another way. Thank you. |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Go to the next blank row in a column (xlDown)
I don't see anything wrong with:
dim rng as range set rng = sheets("Sheet1").Range("A65536").end(xlUp).offset( 1,0) Posting more of you code will make it easier to determine the problem, for example maybe you need to state: .End(xlDown).Offset(1,0) = MyVariable Regards Rowan "tomwashere2" wrote: Does anyone know of a way to have excel go to the next blank row in a column? I currently use XlDown but this only takes me to the last row with values. This causes my macro to overwrite the last row's data and is a significant problem for me. I've used the following suggestions: 1. .End(xlDown).Offset(1,0) Problem: I get a compile error that says "expected = " So then I do, .End(xlDown).Offset = 0 or .End(xlDown).Offset = 1 because this is the only way that does not cause a compile error that I've found. However the problem remains. Excel will go to the last row with values and replace the cell with either (1) or (0). 2. I've also tried: dim rng as range set rng = sheets("Sheet1").Range("A65536").end(xlUp).offset( 1,0) Problem: Same problem as the other. Please tell me what I'm doing wrong or if there is another way. Thank you. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
End(xlDown) not working? | Excel Discussion (Misc queries) | |||
XlDown: Go to next blank row | Excel Programming | |||
Select the next row after xldown range | Excel Programming | |||
xldown and xlright | Excel Programming | |||
(xlDown) not working properly! | Excel Programming |