PC Review


Reply
Thread Tools Rate Thread

copy until certain condition

 
 
=?Utf-8?B?QWxhblc=?=
Guest
Posts: n/a
 
      11th Sep 2007
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 With Quote
 
 
 
 
=?Utf-8?B?T3NzaWVNYWM=?=
Guest
Posts: n/a
 
      11th Sep 2007
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 With Quote
 
=?Utf-8?B?QWxhblc=?=
Guest
Posts: n/a
 
      11th Sep 2007
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 With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Copy & condition Khalil Handal Microsoft Excel Discussion 7 25th Jan 2007 04:48 AM
Copy the value from a cell with condition. Help please excel_guest Microsoft Excel Discussion 4 20th Jun 2006 11:16 AM
Copy Row based on a condition dennis.davis@gmail.com Microsoft Excel Worksheet Functions 1 19th Apr 2006 06:05 PM
search condition- copy Khalil Handal Microsoft Excel Discussion 1 7th Mar 2006 10:36 PM
Copy on condition and paste to last+2 row infojmac Microsoft Excel Programming 5 28th Jun 2004 08:49 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 05:59 PM.