Last Row of Data

  • Thread starter Thread starter Sam Fowler
  • Start date Start date
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
 
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
 
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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top