Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default move cursor to empty row ?

What is the command to move cursor to empty row ?


Regards,
Tee
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9,101
Default move cursor to empty row ?

There is no commands that stops on an empty row. Excel stops on data.
You can get either the last cell of the curent region or the last cell used
on the worksheet. Then you can increment to the next row

set LastCell = ActiveSheet.Cells.SpecialCells(xlCellTypeLastCell)
LastRow = LastCell.Row
EmptyRow = LastRow + 1

"Eng Teng" wrote:

What is the command to move cursor to empty row ?


Regards,
Tee

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 108
Default move cursor to empty row ?

Actually there may be one thing you can do, depending on what your data looks
like: You can simulate the <End<Down key sequence. On your keyboard if
your selected cell has data in it and you hit <End and then one of the arrow
keys, Excel moves the selection to the next empty cell in that direction. If
the selected cell is empty, Excel stops at the first non-blank cell. "Blank"
and "non-blank" in this case refer to cells with no formulae in them;
formulae that display nothing still count as data for the purpose of this
command.

To do this in your program try the End method of a range. You may have to
look up the details, but I think it works like this:

Set EmptyCell = ActiveCell.End(xlDown)
MsgBox "Row " & EmptyCell.Row & " is the first empty row."

Of course End looks for empty (or non-empty) cells, not rows, but if you
know where your data is this often will work for you.

--- "Joel" wrote:
There is no commands that stops on an empty row. Excel stops on data.
You can get either the last cell of the curent region or the last cell used
on the worksheet. Then you can increment to the next row

set LastCell = ActiveSheet.Cells.SpecialCells(xlCellTypeLastCell)
LastRow = LastCell.Row
EmptyRow = LastRow + 1

--- "Eng Teng" wrote:
What is the command to move cursor to empty row ?

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
move cursor on one sheet moves cursor on all sheets tdworden Excel Discussion (Misc queries) 2 July 22nd 07 10:50 PM
Move the cursor to the next row danhattan Excel Programming 2 March 15th 07 04:12 PM
How do I move cursor to next empty space?? WANNABE Excel Programming 6 September 23rd 06 03:58 PM
move cursor Peter[_55_] Excel Programming 7 September 26th 05 06:41 PM
HOW TO MOVE CURSOR Fernando Duran Excel Programming 2 September 17th 03 06:55 PM


All times are GMT +1. The time now is 06:00 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"