kojak43
Active Member
- Joined
- Feb 23, 2002
- Messages
- 270
A week or so ago Dave Hawley kindly gave me the following code.
On the sheet you wish to enter your data, right click on the sheet name tab, select "view Code" and paste in this
Private Sub Worksheet_Change(ByVal Target As Range)
If Not Intersect(Target, Range("A2:Q2000")) Is Nothing Then
Sheets("Sheet2").Range(Target.Address) = Target
Sheets("Sheet3").Range(Target.Address) = Target
End If
End Sub
From now on whenever you enter any data on this sheet it within the range "A2:Q1000" it will be automatically mirrored on sheet2 and 3
As it say's it will place all the values from one sheet into two other sheets.
In Sheet 1 the data goes from A2:Q2000. However I only wish to take certain cells from Sheet 1 and place them in Sheet2, and those cells, from sheet1 are not adjacent
I start in A2:A2000, C2:C2000, F2:G2000, J2:O2000 and R2:S2000.
So how can I modify the code to make it work.
What I put in, results in a runtime error 1004. What I did was change A2:Q2000 to read ("Sheet1!A2:A2000, Sheet1C2:C2000") Etc
Any help is greatly appreciated.
K
On the sheet you wish to enter your data, right click on the sheet name tab, select "view Code" and paste in this
Private Sub Worksheet_Change(ByVal Target As Range)
If Not Intersect(Target, Range("A2:Q2000")) Is Nothing Then
Sheets("Sheet2").Range(Target.Address) = Target
Sheets("Sheet3").Range(Target.Address) = Target
End If
End Sub
From now on whenever you enter any data on this sheet it within the range "A2:Q1000" it will be automatically mirrored on sheet2 and 3
As it say's it will place all the values from one sheet into two other sheets.
In Sheet 1 the data goes from A2:Q2000. However I only wish to take certain cells from Sheet 1 and place them in Sheet2, and those cells, from sheet1 are not adjacent
I start in A2:A2000, C2:C2000, F2:G2000, J2:O2000 and R2:S2000.
So how can I modify the code to make it work.
What I put in, results in a runtime error 1004. What I did was change A2:Q2000 to read ("Sheet1!A2:A2000, Sheet1C2:C2000") Etc
Any help is greatly appreciated.
K