Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 29
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,510
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 29
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Copy and Paste based on Condition EJ Excel Discussion (Misc queries) 1 June 27th 07 11:17 PM
copy data to another sheet on condition vijaydsk1970 Excel Worksheet Functions 1 March 22nd 07 04:12 AM
Copy Row based on a condition [email protected] Excel Worksheet Functions 1 April 19th 06 06:05 PM
copy line with 2 condition.... sal21 Excel Programming 0 October 14th 05 03:39 PM
Copy on condition and paste to last+2 row infojmac[_4_] Excel Programming 5 June 28th 04 08:49 AM


All times are GMT +1. The time now is 11:08 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"