PC Review


Reply
Thread Tools Rate Thread

copy the data to all the columns

 
 
Ranjith Kurian
Guest
Posts: n/a
 
      1st May 2010
Hi,

I have 5000 names in a excel sheet and after every name there is blank row,
i need macro to copy the DEPT and CCentre data to all the names example as
shown below

Name DEPT CCENTRE
A1 A P
A1 S U
A1 D Y
A1 R K

B2 A P
B2 S U
B2 D Y
B2 R K
B2

 
Reply With Quote
 
 
 
 
Abhi
Guest
Posts: n/a
 
      2nd May 2010
Hi All,

Please Tell Me [ How to open Hidden excel Sheet But Only I Follow the
Hyperlink ]
& Please Send me Screen Shot ok

Thanks
Abhijeet
 
Reply With Quote
 
Nick
Guest
Posts: n/a
 
      3rd May 2010
Hi Ranjith-


If I understand your issue correctly, there are two options for doing this:


(1)Highlight the cells you want to copy including a row of empty cells and
drag this until the end of your document.

(2)If all the data you want to copy is found in “B2:C5” and there are four
names between each space the following code should work:
Option Explicit
Dim X As Long


Sub RepeatCopy()

Range("B2").Select
Range(Selection, Selection.End(xlDown)).Select
Range(Selection, Selection.End(xlToRight)).Select
Selection.Copy

X = 0

Do

Range("b7").Offset(5 * X, 0).Select
ActiveSheet.Paste
Selection.End(xlDown).Select
Selection.End(xlToLeft).Select
' Selection.End(xlDown).Select
X = X + 1
Loop Until IsEmpty(ActiveCell.Offset(2, 0))

End Sub


"Ranjith Kurian" wrote:

> Hi,
>
> I have 5000 names in a excel sheet and after every name there is blank row,
> i need macro to copy the DEPT and CCentre data to all the names example as
> shown below
>
> Name DEPT CCENTRE
> A1 A P
> A1 S U
> A1 D Y
> A1 R K
>
> B2 A P
> B2 S U
> B2 D Y
> B2 R K
> B2
>

 
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
How to copy specific columns until end of data Matt G. Microsoft Excel Discussion 1 26th Oct 2006 08:05 AM
Compare Columns and Copy Data lltaylor2000@yahoo.com Microsoft Excel Programming 1 18th Aug 2006 02:03 PM
copy data columns (include the data rows) =?Utf-8?B?c3RhbmxleQ==?= Microsoft ADO .NET 3 10th Oct 2005 03:02 PM
Re: Copy Data to Rows instead of Columns Donnie Stone Microsoft Excel Programming 1 18th Sep 2003 03:14 AM
Copy Data to Rows instead of Columns Donnie Stone Microsoft Excel Programming 0 17th Sep 2003 11:10 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 08:03 AM.