Referencing worksheets

N

NewExcelGuy

I am trying to figure out a way to reference a value from one sheet t
another. I know how to go to sheet 2 and "receive" a value from shee
1 (=sheet1!a1), but I don't know how to take a value from sheet1 an
"send" it to sheet 2 (??).

Also, say I have a workbook with one worksheet in it titled "RED". I
there a way for me to say if there is a value in cell b2 on workshee
"RED" for Excel to automatically create a new workskeet and title i
"BLUE"?

One more thing. Regardless of whether both of these can be don
separately, is there a way to do them simultaneously
 
D

Don

Copy code below
Alt-F11 to open the VBA editor
Insert module from the menubar
Paste the sub
Alt-Q to go back to excel

Alt-F8
Select test
Run



' Sub starts here
Sub test()
Sheets("red").Select
If Range("b2") = "something" Then Worksheets.Add.Name = "Blue"
ActiveSheet.Range("a1") = Sheets("red").Range("b2")
Sheets("red").Select
End Sub

I hope this helps





"NewExcelGuy" <[email protected]>
wrote in message
news:[email protected]...
 
D

Don

Actually, this would be better:


Sub test()
Sheets("red").Select
If Range("b2") = "something" Then
Worksheets.Add.Name = "Blue"
ActiveSheet.Range("a1") = Sheets("red").Range("b2")
Else
End If
Sheets("red").Select
End Sub
 
Top