Automate infil of data into a cell on subsequent worksheets.

S

simon

I have sheet One.
Sheet one, amongst other info, has a list of reference numbers in Column A.

I want to generate a load of other individual sheets in the workbook that
subsequently reference the values in column in Sheet 1.

EG.
On Sheet 1
A1 = Ref No1
A2 = Ref No2
A3 = Ref No3
A4 = Ref No4

---------
All other sheets are templates with identical layout
How can I quickly populate all the values in Cell A1, on sheets 2 onwards
such that:

Sheet 2 A1 = Value in Sheet1, CellA1
Sheet 3 A1 = Value in Sheet1, CellA2
Sheet 4 A1 = Value in Sheet1, CellA3
Sheet 5 A1 = Value in Sheet1, CellA4
Sheet 6 A1 = Value in Sheet1, CellA5
Sheet 7 A1 = Value in Sheet1, CellA6

SS.
 
T

Tom Ogilvy

assuming you have N values and N+1 sheets, with the list of values on sheet
1

for each sh in sheets
if sh.Index <> 1 then
sh.Range("A1").Value = Sheet(1).Cells(sh.Index-1,1).Value
end if
Next
 
T

Tom Ogilvy

Its called a macro, since posted in programming. Here are some help
articles for getting your feet on the ground.

http://www.mvps.org/dmcritchie/excel/getstarted.htm

http://web.archive.org/web/20031204...cid=/support/excel/content/vba101/default.asp

http://msdn.microsoft.com/office/un...ibrary/en-us/odc_xl2003_ta/html/odc_super.asp

http://msdn.microsoft.com/office/understanding/excel/gettingstarted/default.aspx

http://www.mvps.org/dmcritchie/excel/excel.htm#tutorials

If you can't be bothered. then copy th code below, do Alt+F11, insert
=>Module, paste then Alt+F11 back to excel. Tools=>Macro=>Macros, select
AAAA and click the run button. Recall the previous conditions.

Sub AAAAA()
Dim sh As Worksheet
For Each sh In Sheets
If sh.Index <> 1 Then
sh.Range("A1").Value = _
Sheets(1).Cells(sh.Index - 1, 1).Value
End If
Next
End Sub
 
S

simon

Tom.

Got it working thanks...

You've saved me an awful lot of cutting and pasting!!

SS
 

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