Automate infil of data into a cell on subsequent worksheets. (Again)
I was given the code below,which puts the value from Column A into
subsequent worksheets working down the column. Value from A1 goes into Worksheet2, A2 goes into Worksheet 3..etc... How do I change the code such that the source data is in the range C2 downwards. I.E. What in the code defines the first source of the data? [I'm guessing it's in this bit Cells(sh.Index - 1, 1). ] SS Sub AAAAA() Dim sh As Worksheet For Each sh In Sheets If sh.Index < 1 Then sh.Range("Cell number you want the data on in each sheet goes in here").Value = _ Sheets(1).Cells(sh.Index - 1, 1).Value End If Next End Sub |
Automate infil of data into a cell on subsequent worksheets. (Again)
Simon,
Try changing Sheets(1).Cells(sh.Index - 1, 1).Value to Sheets(1).Cells(sh.Index, 3).Value HTH, Bernie MS Excel MVP "simon" wrote in message ... I was given the code below,which puts the value from Column A into subsequent worksheets working down the column. Value from A1 goes into Worksheet2, A2 goes into Worksheet 3..etc... How do I change the code such that the source data is in the range C2 downwards. I.E. What in the code defines the first source of the data? [I'm guessing it's in this bit Cells(sh.Index - 1, 1). ] SS Sub AAAAA() Dim sh As Worksheet For Each sh In Sheets If sh.Index < 1 Then sh.Range("Cell number you want the data on in each sheet goes in here").Value = _ Sheets(1).Cells(sh.Index - 1, 1).Value End If Next End Sub |
All times are GMT +1. The time now is 12:01 AM. |
Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com