Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 13
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 38
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
End(xlDown) not working? RAHokie Excel Discussion (Misc queries) 2 January 19th 07 12:40 AM
XlDown: Go to next blank row tomwashere2 Excel Programming 2 August 16th 05 11:15 PM
Select the next row after xldown range ExcelMonkey[_108_] Excel Programming 2 March 5th 04 10:03 PM
xldown and xlright He4Giv Excel Programming 2 January 29th 04 12:41 AM
(xlDown) not working properly! aapp81[_25_] Excel Programming 7 December 10th 03 08:28 AM


All times are GMT +1. The time now is 05:02 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"