Copy and paste a name list across worksheets

C

chungacs

I have an excel worksheet which is a name list of some 50 names. I also have
a workbook which is a collection of some 50 worksheets. Now I want to insert
these names, one by one, into cell A1 of each of the 50 worksheets. Is there
a way to do so in one go, instead of having to copy and paste each name, one
at a time, into cell A1 of each worksheet. Thanks
 
O

Otto Moehrbach

This little macro will do that for you. I assumed that the sheet that holds
the list of names is named "Names". Change this as you wish. I also
assumed that the names are in Column A and start in A2. HTH Otto
Sub PlaceNames()
Dim rColA As Range
Dim i As Range
Dim c As Long
c = 1
Set rColA = Range("A2", Range("A" & Rows.Count).End(xlUp))
For Each i In rColA
If Worksheets(c).Name = "Names" Then c = c + 1
Worksheets(c).Range("A1").Value = i.Value
c = c + 1
Next i
End Sub
 
C

Chung HT

Otto Moehrbach said:
This little macro will do that for you. I assumed that the sheet that
holds the list of names is named "Names". Change this as you wish. I
also assumed that the names are in Column A and start in A2. HTH Otto
Sub PlaceNames()
Dim rColA As Range
Dim i As Range
Dim c As Long
c = 1
Set rColA = Range("A2", Range("A" & Rows.Count).End(xlUp))
For Each i In rColA
If Worksheets(c).Name = "Names" Then c = c + 1
Worksheets(c).Range("A1").Value = i.Value
c = c + 1
Next i
End Sub
"chungacs" <[email protected]> wrote in message

Thanks a lot
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top