ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Is there a command in visual basic to move down one space, e.g. m. (https://www.excelbanter.com/excel-programming/341296-there-command-visual-basic-move-down-one-space-e-g-m.html)

Brent

Is there a command in visual basic to move down one space, e.g. m.
 
I am trying to set up a macro to copy an array of data with a known number of
columns, but an unknown number of rows into a spreadsheet. I have several
worksheets of data that are constantly being updated and would like to copy
the data into one spreadsheet every week or so by running the macro. The
macro recognizes "ctrl+downarrow" and scrolls to the last row of data, but if
I hit the down arrow or "enter", the visual basic records this as selecting a
cell, and not scrolling down one space.

Any ideas? Thanks.

Robin Hammond[_2_]

Is there a command in visual basic to move down one space, e.g. m.
 
Brent,

Assuming column 1 is filled you can use variants on this

Dim lLastRow as Long
lLastRow = activesheet.range("a1").end(xldown).row

Robin Hammond
www.enhanceddatasystems.com

"Brent" wrote in message
...
I am trying to set up a macro to copy an array of data with a known number
of
columns, but an unknown number of rows into a spreadsheet. I have several
worksheets of data that are constantly being updated and would like to
copy
the data into one spreadsheet every week or so by running the macro. The
macro recognizes "ctrl+downarrow" and scrolls to the last row of data, but
if
I hit the down arrow or "enter", the visual basic records this as
selecting a
cell, and not scrolling down one space.

Any ideas? Thanks.





All times are GMT +1. The time now is 11:05 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com