Thanks Thanks:  0
Likes Likes:  0
Results 1 to 4 of 4

Thread: Macor Needed

  1. #1
    New Member
    Join Date
    Apr 2002
    Posts
    8
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    Green user of excel, yet have manager’s who like cool stuff.

    I need a macro that will look at cell E12 of the tab entitled “worksheet” and depending on the value of E12 it will print the tab “A” or tab “b” or tab “c”.

    I dug around in the past posts but can’t find it. I think it is an If and else if statement but can’t seem to make it work.

    Any help? Thanks.

  2. #2
    MrExcel MVP Al Chara's Avatar
    Join Date
    Feb 2002
    Location
    Newark, Delaware
    Posts
    1,701
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    It can be done in an if statement, try the following:

    If Worksheets("Worksheet").[e12].Value = "A" Then
    Worksheets("A").PrintOut
    ElseIf Worksheets("Worksheet").[e12].Value = "B" Then
    Worksheets("B").PrintOut
    ElseIf Worksheets("Worksheet").[e12].Value = "C" Then
    Worksheets("C").PrintOut
    End If
    Best regards,
    Allan Chara
    http://www.mrspreadsheets.com

  3. #3
    New Member
    Join Date
    Apr 2002
    Posts
    8
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    That seems to easy. I will give it a try. Thanks!


  4. #4
    MrExcel MVP Jay Petrulis's Avatar
    Join Date
    Mar 2002
    Location
    Chicago, IL USA
    Posts
    2,040
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    On 2002-04-09 11:57, heather wrote:
    Green user of excel, yet have manager’s who like cool stuff.

    I need a macro that will look at cell E12 of the tab entitled “worksheet” and depending on the value of E12 it will print the tab “A” or tab “b” or tab “c”.

    I dug around in the past posts but can’t find it. I think it is an If and else if statement but can’t seem to make it work.

    Any help? Thanks.
    Hi Heather,

    What are the values that are allowed in E12. What criteria determines which sheet?

    If all you will place in the cell is "A", "B", or "C" then try:

    ------------------------
    Sub print_choice()
    Dim RangeVal As String

    On Error Resume Next
    RangeVal = Sheets("Worksheet").Range("E12")
    Sheets(RangeVal).PrintOut
    On Error Goto 0

    End Sub
    -------------------

    If there are other worksheet selection paramters, then please post back.

    Bye,
    Jay

Some videos you may like

User Tag List

Like this thread? Share it with others

Like this thread? Share it with others

Posting Permissions

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