PC Review


Reply
Thread Tools Rate Thread

Copying Value to Range

 
 
willwonka
Guest
Posts: n/a
 
      14th Jul 2011
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.



 
Reply With Quote
 
 
 
 
Claus Busch
Guest
Posts: n/a
 
      14th Jul 2011
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
 
Reply With Quote
 
willwonka
Guest
Posts: n/a
 
      14th Jul 2011
Works perfect!!!!!!

Thanks.


On Jul 14, 9:58*am, Claus Busch <claus_bu...@t-online.de> 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


 
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
Which is faster, copying range to another set of ranges or copying tomemory? axwack Microsoft Excel Programming 2 12th Dec 2007 01:19 PM
Copying Range Based On Certain Criteria? Possible looping through the Range Big H Microsoft Excel Programming 1 27th Oct 2006 03:32 AM
copying dynamic range based on cell outside of range xcelelder Microsoft Excel Programming 3 29th Sep 2005 05:08 PM
Need VBA Help in Copying Range WayneK Microsoft Excel Programming 5 6th Jun 2005 07:31 PM
Searching a range and copying values into a new range.... **Please help** :( Lancia Microsoft Excel Programming 1 29th Sep 2004 01:08 PM


Features
 

Advertising
 

Newsgroups
 


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