Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
copy until certain condition
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 |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
copy until certain condition
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 "AlanW" wrote: 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 |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
copy until certain condition
Hello OssieMac,
That's what I want to do, many Thanks Alan "OssieMac" wrote: 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 "AlanW" wrote: 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 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Copy and Paste based on Condition | Excel Discussion (Misc queries) | |||
copy data to another sheet on condition | Excel Worksheet Functions | |||
Copy Row based on a condition | Excel Worksheet Functions | |||
copy line with 2 condition.... | Excel Programming | |||
Copy on condition and paste to last+2 row | Excel Programming |