PC Review


Reply
Thread Tools Rate Thread

copy cells to end of range in other column

 
 
=?Utf-8?B?RXJpY19H?=
Guest
Posts: n/a
 
      15th Aug 2007
I believe this question has been answered previously, but I can't easily
locate the answer.

I wish to copy cell value "Y2" to cells Y3 downward to the last row where a
value exists in column X.

Any suggestions?
 
Reply With Quote
 
 
 
 
Ron de Bruin
Guest
Posts: n/a
 
      15th Aug 2007
Try this one for "Sheet1"

Sub test()
With Worksheets("Sheet1")
Set SourceRange = .Range("Y2")
Set fillRange = .Range("Y2:Y" & .Cells(Rows.Count, "X").End(xlUp).Row)
End With
SourceRange.AutoFill Destination:=fillRange
End Sub


--

Regards Ron de Bruin
http://www.rondebruin.nl/tips.htm


"Eric_G" <(E-Mail Removed)> wrote in message news:6AF0D014-7812-45B6-9C64-(E-Mail Removed)...
>I believe this question has been answered previously, but I can't easily
> locate the answer.
>
> I wish to copy cell value "Y2" to cells Y3 downward to the last row where a
> value exists in column X.
>
> Any suggestions?

 
Reply With Quote
 
=?Utf-8?B?Sm9lbA==?=
Guest
Posts: n/a
 
      15th Aug 2007

Sub copydown()

LastRowX = Cells(Rows.Count, "X").End(xlUp).Row
Set pasterange = Range(Cells(3, "Y"), Cells(LastRowX, "Y"))

Range("Y2").Copy Destination:=pasterange

End Sub

"Eric_G" wrote:

> I believe this question has been answered previously, but I can't easily
> locate the answer.
>
> I wish to copy cell value "Y2" to cells Y3 downward to the last row where a
> value exists in column X.
>
> Any suggestions?

 
Reply With Quote
 
=?Utf-8?B?RXJpY19H?=
Guest
Posts: n/a
 
      17th Aug 2007
Than you both -- worked fine.

"Joel" wrote:

>
> Sub copydown()
>
> LastRowX = Cells(Rows.Count, "X").End(xlUp).Row
> Set pasterange = Range(Cells(3, "Y"), Cells(LastRowX, "Y"))
>
> Range("Y2").Copy Destination:=pasterange
>
> End Sub
>
> "Eric_G" wrote:
>
> > I believe this question has been answered previously, but I can't easily
> > locate the answer.
> >
> > I wish to copy cell value "Y2" to cells Y3 downward to the last row where a
> > value exists in column X.
> >
> > Any suggestions?

 
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 a column of single cells into a column of merged cells clairejane_99@hotmail.com Microsoft Excel Discussion 3 17th Aug 2006 02:27 PM
copy a range with known start column to variable end column =?Utf-8?B?TWF0aWxkYQ==?= Microsoft Excel Programming 2 2nd Aug 2006 04:55 PM
Copy column range of "single word" cells with spaces to a single c =?Utf-8?B?bmFzdGVjaA==?= Microsoft Excel Misc 3 15th Feb 2006 05:04 PM
How to use macros to copy a range of cells which can exclude some cells which I didn't want to be copied? excelnovice Microsoft Excel Worksheet Functions 2 25th Sep 2005 12:38 AM
Copy cells into range of cells until cell change =?Utf-8?B?bWRlYW5kYQ==?= Microsoft Excel Worksheet Functions 1 22nd Apr 2005 08:41 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 05:18 AM.