import data after last line of data

  • Thread starter Thread starter mepetey
  • Start date Start date
M

mepetey

I need to be able to import data from one worksheet to another. I am ok
with the macro to select and copy the new data from the source sheet, but I
need to be able to identify the last "occupied" row in the target sheet, so
as not to overwrite. Is there a simple way to do this? any help greatly
appreciated.
 
hi,
not sure what you mean by "occupied" but if you mean select the last row of
data in a range then...

Range("A65000").end(xlup).offset(1,0).select

this would set you at the next empty cell, column A, ready to paste.

regards
FSt1
 
Hi mepetey.
Try:

R = ActiveSheet.UsedRange.Rows.Count 'last row
C = ActiveSheet.UsedRange.Columns.Count 'last column

Regards
Eliano
 
Hi mepetey.
Try:

R = ActiveSheet.UsedRange.Rows.Count 'last row
C = ActiveSheet.UsedRange.Columns.Count 'last column

Regards
Eliano





- Show quoted text -

Hi,

Try this. Change the cell reference in Range("A1") to refer to your
desired location.
Range("A1").Select
Do
If IsEmpty(ActiveCell) = False Then
ActiveCell.Offset(1, 0).Select
End If
Loop Until IsEmpty(ActiveCell) = True
ActiveCell.Value = "New"

Regards
TrevoseF
 
Perfect.!

Thanks TrevoseF



Hi,

Try this. Change the cell reference in Range("A1") to refer to your
desired location.
Range("A1").Select
Do
If IsEmpty(ActiveCell) = False Then
ActiveCell.Offset(1, 0).Select
End If
Loop Until IsEmpty(ActiveCell) = True
ActiveCell.Value = "New"

Regards
TrevoseF
 

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