+ Reply to Thread
Results 1 to 3 of 3

Referencing worksheets

  1. #1
    Registered User
    Join Date
    09-10-2005
    Posts
    1

    Referencing worksheets

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

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

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

  2. #2
    Don
    Guest

    Re: Referencing worksheets

    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]...
    >
    > I am trying to figure out a way to reference a value from one sheet to
    > another. I know how to go to sheet 2 and "receive" a value from sheet
    > 1 (=sheet1!a1), but I don't know how to take a value from sheet1 and
    > "send" it to sheet 2 (??).
    >
    > Also, say I have a workbook with one worksheet in it titled "RED". Is
    > there a way for me to say if there is a value in cell b2 on worksheet
    > "RED" for Excel to automatically create a new workskeet and title it
    > "BLUE"?
    >
    > One more thing. Regardless of whether both of these can be done
    > separately, is there a way to do them simultaneously?
    >
    >
    > --
    > NewExcelGuy
    > ------------------------------------------------------------------------
    > NewExcelGuy's Profile:
    > http://www.excelforum.com/member.php...o&userid=27141
    > View this thread: http://www.excelforum.com/showthread...hreadid=466567
    >




  3. #3
    Don
    Guest

    Re: Referencing worksheets

    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



    "Don" <[email protected]> wrote in message
    news:[email protected]...
    > 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]...
    >>
    >> I am trying to figure out a way to reference a value from one sheet to
    >> another. I know how to go to sheet 2 and "receive" a value from sheet
    >> 1 (=sheet1!a1), but I don't know how to take a value from sheet1 and
    >> "send" it to sheet 2 (??).
    >>
    >> Also, say I have a workbook with one worksheet in it titled "RED". Is
    >> there a way for me to say if there is a value in cell b2 on worksheet
    >> "RED" for Excel to automatically create a new workskeet and title it
    >> "BLUE"?
    >>
    >> One more thing. Regardless of whether both of these can be done
    >> separately, is there a way to do them simultaneously?
    >>
    >>
    >> --
    >> NewExcelGuy
    >> ------------------------------------------------------------------------
    >> NewExcelGuy's Profile:
    >> http://www.excelforum.com/member.php...o&userid=27141
    >> View this thread:
    >> http://www.excelforum.com/showthread...hreadid=466567
    >>

    >
    >




+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1