I'm not sure whether this should be a general question or it should go in the programming section... but here here goes anyways
I need to create a spreadsheet where the contents of Col A & B in Sheet1 are copied into both Col A & B in Sheet2 & Sheet3. Sheet1 Col A&B will be continuously updated (rows will be added) and as these columns are updated, Col A & B in Sheet2 & Sheet3 should be updated automatically and keep the format that is set in Col A & B in Sheet1.
Now, Col C&D in Sheet2 & 3 will be updated by a different user. As the user updates the cells in Col C&D in Sheet2 & 3, Col C&D in Sheet1 should automatically be updated with the data in the cells of Col C&D in Sheet2 (and keep the format) and Col E&F in Sheet1 should automatically be updated with the data in the cells of Col C&D in Sheet3 (and keep the format).
Thanks!
Last edited by BluTalon; 11-05-2008 at 11:42 AM.
Bump - No Response
You don't ever resort the data, do you? If not, standard relative references would suffice, wouldn't they?
Copy over one cell, then down as far as you want.On Sheet2 cell A2 =Sheet1!A2
Do the opposite for C/D and E/F.
_________________
Microsoft MVP 2010 - Excel
Visit: Jerry Beaucaire's Excel Files & Macros
If you've been given good help, use theicon below to give reputation feedback, it is appreciated.
Always put your code between code tags. [CODE] your code here [/CODE]
“None of us is as good as all of us” - Ray Kroc
“Actually, I *am* a rocket scientist.” - JB (little ones count!)
I tired that, but when I do relative references to Sheet2 it doesn't keep the formatting from Sheet1. Any ideas on how the formatting can be kept?
I would set my formatting ahead of time myself one time going down as far as I think I need it for this sheet. If it's a repetitive format, or alternating, once you've done a set that looks right, use the Format Painter to paint the formatting settings into the cells below in the same pattern. Quick and easy.
_________________
Microsoft MVP 2010 - Excel
Visit: Jerry Beaucaire's Excel Files & Macros
If you've been given good help, use theicon below to give reputation feedback, it is appreciated.
Always put your code between code tags. [CODE] your code here [/CODE]
“None of us is as good as all of us” - Ray Kroc
“Actually, I *am* a rocket scientist.” - JB (little ones count!)
The thing is that there is no real repetitive pattern for the formatting. There will be a header that will be in bold black, then the rows below that will vary on the amount of data for that particular batch. Once that batch is done, another header row will be added below that with a varying amount of rows below that.
The person editing Sheet2 will not be allowed to edit Sheet1, but the formatting will have a certain significance for the person looking at Sheet1. If the text is red in Sheet2, it will mean that that cell is not ready for the person looking at Sheet1. Does that kind of make sense?
As far as I know, you can't move formats without code, hence:
Fairly basic but it does the job.Private Sub Workbook_SheetChange(ByVal Sh As Object, ByVal Target As Range) Application.EnableEvents = False Select Case Sh.Name Case "Sheet1" If Target.Column < 3 Then Sheets(Sh.Name).Columns("A:B").Copy Sheets("Sheet2").Columns("A:B") Sheets(Sh.Name).Columns("A:B").Copy Sheets("Sheet3").Columns("A:B") End If Case "Sheet2" If Target.Column = 3 Or Target.Column = 4 Then Sheets(Sh.Name).Columns("C:D").Copy Sheets("Sheet1").Columns("C:D") Case "Sheet3" If Target.Column = 3 Or Target.Column = 4 Then Sheets(Sh.Name).Columns("C:D").Copy Sheets("Sheet1").Columns("E:F") End Select Application.EnableEvents = True End Sub
HTH
Last edited by Cheeky Charlie; 11-07-2008 at 09:38 AM. Reason: oops
Thank you! It works great.![]()
Shouldn't that last bit of code copy from Sheet 3 C/D to Sheet 1 E/F?
Case "Sheet3" If Target.Column = 3 Or Target.Column = 4 Then Sheets(Sh.Name).Columns("C:D").Copy Sheets("Sheet1").Columns("E:F") End Select
_________________
Microsoft MVP 2010 - Excel
Visit: Jerry Beaucaire's Excel Files & Macros
If you've been given good help, use theicon below to give reputation feedback, it is appreciated.
Always put your code between code tags. [CODE] your code here [/CODE]
“None of us is as good as all of us” - Ray Kroc
“Actually, I *am* a rocket scientist.” - JB (little ones count!)
That's exactly what it does do (?)Shouldn't that last bit of code copy from Sheet 3 C/D to Sheet 1 E/F?
have a look at the help file for copy method, basically it comes down to:
(item).copy (destination)
CC
Because the three things he needed to happen were:That last line of code in CASE3, both destinations should be Sheet1 and to my mind, the 2nd reads as Sheet2 as the destination.
- Two columns from Sheet1 copied to 2 & 3 (OK)
- Two columns from Sheet2 copied to Sheet1 (OK)
- Two columns from Sheet3 copied to Sheet1 (seems to be missing)
Am I reading it wrong?
Case "Sheet2" If Target.Column = 3 Or Target.Column = 4 Then Sheets(Sh.Name).Columns("C:D").Copy Sheets("Sheet1").Columns("C:D") Case "Sheet3" If Target.Column = 3 Or Target.Column = 4 Then Sheets(Sh.Name).Columns("C:D").Copy Sheets("Sheet2").Columns("E:F")
Last edited by VBA Noob; 11-07-2008 at 08:25 AM.
_________________
Microsoft MVP 2010 - Excel
Visit: Jerry Beaucaire's Excel Files & Macros
If you've been given good help, use theicon below to give reputation feedback, it is appreciated.
Always put your code between code tags. [CODE] your code here [/CODE]
“None of us is as good as all of us” - Ray Kroc
“Actually, I *am* a rocket scientist.” - JB (little ones count!)
oh... um... no
oops
(original code revised rather than entire repost)
Thank God! I don't program at the level you guys do, so I am desperately trying to teach myself/understand the advanced stuff you guys post...so I'm glad I'm able to decipher some of it properly. Hehe.
_________________
Microsoft MVP 2010 - Excel
Visit: Jerry Beaucaire's Excel Files & Macros
If you've been given good help, use theicon below to give reputation feedback, it is appreciated.
Always put your code between code tags. [CODE] your code here [/CODE]
“None of us is as good as all of us” - Ray Kroc
“Actually, I *am* a rocket scientist.” - JB (little ones count!)
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks