Macor Needed

heather

New Member
Joined
Apr 8, 2002
Messages
8
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.
 

Excel Facts

How to create a cell-sized chart?
Tiny charts, called Sparklines, were added to Excel 2010. Look for Sparklines on the Insert tab.
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
 
Upvote 0
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
 
Upvote 0

Forum statistics

Threads
1,214,907
Messages
6,122,181
Members
449,071
Latest member
cdnMech

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top