copy until certain condition

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I would like to copy B1 to B2:B1000 until a cell in Column A is empty by
using VBA. Could someone please help.

Thanks
 
Hi Alan,

I am not certain that I understand exactly what you want to do because your
description is a little vague.

I interpret your request as you want to copy cell B1 and paste the contents
down in column B until it comes to a blank cell in column A. If this is right
then you can use the following:-

With Sheets("Sheet1")
.Range("B1").Copy _
Destination:=.Range(.Cells(2, 1) _
.End(xlDown).Offset(0, 1), .Cells(2, 2))
End With

You may replace the line With Sheets("Sheet1") with the following line if it
will always be the active sheet:-

With ActiveSheet

If my interpretation is not correct then please reply and I'll have another
go at it.

Regards,

OssieMac
 

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