ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Copying Value to Range (https://www.excelbanter.com/excel-programming/444772-copying-value-range.html)

willwonka[_4_]

Copying Value to Range
 
Yet another seemingly easy task, that I can't quite get. Here we go.

I have a process that copes some data to a column and then copies a
parent to the next column. I would like to fill that parent to all of
the rows.

So after process, it looks like this:

JC4100 JC4100
JC41003002
JC41003003
JC41001040
JC41009998
JC41016041
JC4100H

I want it to look like this:

JC4100 JC4100
JC41003002 JC4100
JC41003003 JC4100
JC41001040 JC4100
JC41009998 JC4100
JC41016041 JC4100
JC4100H JC4100

Doing a simple Macro Record gets me this:

Selection.Copy
Range("F134:G134").Select
Range("G134").Activate
Range(Selection, Selection.End(xlDown)).Select
Range("G134:G140").Select
ActiveSheet.Paste

My task is to make that sub more relative and more compact (or
course). Because more things will be copied to the bottom of this
list after this is filled in.

Thanks.




Claus Busch

Copying Value to Range
 
Hi,

Am Thu, 14 Jul 2011 07:39:09 -0700 (PDT) schrieb willwonka:

I want it to look like this:

JC4100 JC4100
JC41003002 JC4100
JC41003003 JC4100
JC41001040 JC4100
JC41009998 JC4100
JC41016041 JC4100
JC4100H JC4100


you select a cell in column F to copy your values. Then try:

LRow = Cells(Rows.Count, "F").End(xlUp).Row
Range("G" & ActiveCell.Row & ":G" & LRow) = ActiveCell


Regards
Claus Busch
--
Win XP PRof SP2 / Vista Ultimate SP2
Office 2003 SP2 /2007 Ultimate SP2

willwonka[_4_]

Copying Value to Range
 
Works perfect!!!!!!

Thanks.


On Jul 14, 9:58*am, Claus Busch wrote:
Hi,

Am Thu, 14 Jul 2011 07:39:09 -0700 (PDT) schrieb willwonka:

I want it to look like this:


JC4100 * * * * * * * * * * JC4100
JC41003002 JC4100
JC41003003 JC4100
JC41001040 JC4100
JC41009998 JC4100
JC41016041 JC4100
JC4100H * * * * * * * * * *JC4100


you select a cell in column F to copy your values. Then try:

LRow = Cells(Rows.Count, "F").End(xlUp).Row
Range("G" & ActiveCell.Row & ":G" & LRow) = ActiveCell

Regards
Claus Busch
--
Win XP PRof SP2 / Vista Ultimate SP2
Office 2003 SP2 /2007 Ultimate SP2




All times are GMT +1. The time now is 04:44 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com