Last Row of Data

S

Sam Fowler

Hi:

Can any one tell me how I would go about selecting a
specific worksheet, then finding the last row with data
in it, selecting the next row and pasting in copied data
from another worksheet.

Thanks,

Sam
 
C

Chip Pearson

Sam,

Try something like

Dim LastCell As Range
Set LastCell = Worksheets("Sheet1").Cells(Rows.Count,
"A").End(xlUp)(2, 1)
LastCell.Worksheet.Select
LastCell.Select


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com
 
B

Bob Flanagan

Sam, to select a worksheet:

Worksheets("mysheetname").Select

To find the last cell with an entry in a column A

Dim cell as range
Set cell = cells(65536,1).end(xlup)

To specify the next blank cell down:
Set cell = cell.offset(1,0)

To copy data from another worksheet in the same workbook to this location:

Worksheets("some other sheet").Range("A1:Z1").Copy cell

or to copy a row from another worksheet:

Worksheets("some other sheet").Rows(5).Copy cell

Bob Flanagan
Macro Systems
http://www.add-ins.com
Productivity add-ins and downloadable books on VB macros for Excel
 
Top