printing according to worksheet name

virgilgarcia

New Member
Joined
May 23, 2011
Messages
10
Hi all,

I am totally new to this forum. I've read some of the other threads, and I must say there are quite a lot of proficient excel users here. Hopefully I can be able to contribute my own thoughts in the future as well.

Calling all experts, I really hope you can help me on this problem of mine (at least it's a problem for me. I have minimal background in VBA).

I'm need a macro that can print based on worksheet name. This is the idea that I have in mind:

In the first sheet, there will be an area wherein I can simply type (and save) the names of the worksheets that I would like to print. And then, the macro will scan this area and then print only the relevant worksheets based on name.

For example, my workbook has the following sheets:
A
B
C
D
E
F
G
H

In sheet A, I will type this in a certain area:
B
C
F
H

This way, the macro will scan the said area an print only the sheets with names that are stored in sheet A.

Any helpful comments and/or suggestions would be sincerely appreciated!

Regards,
Virgil
 

Excel Facts

Highlight Duplicates
Home, Conditional Formatting, Highlight Cells, Duplicate records, OK to add pink formatting to any duplicates in selected range.
Assuming all you have in column A of sheet "A" is the list of sheet names, this would do what you want:


Sub PrintSheetz()
Dim cell As Range
For Each cell In Sheets("A").Columns(1).SpecialCells(2)
Sheets(cell.Value).PrintOut
Next cell
End Sub
 
Upvote 0
Sub PrintSheetzAgain()
Dim cell As Range
For Each cell In Sheets("Y").Columns(24).SpecialCells(2)
Sheets(cell.Value).PrintOut
Next cell
End Sub <!-- / message --><!-- sig -->
 
Upvote 0
I have another question.

Is it possible for me to consolidate this, say, by storing this macro in the "Personal" workbook and simply access this one everytime for different files?
 
Upvote 0
I'd like to turn this macro into a more centralized one, meaning I can access it from any workbook that is being currently active. And then the macro would scan the said column of the said tab (all of the workbooks would contain this tab, but these individual tabs would contain different names). Is there a way for me to do this?
 
Upvote 0
As I suggested, I'd opt for an add-in. Steps slightly vary depending on the version of Excel you are using, so if you don't know how to set up an add-in, post back.
 
Upvote 0
Hi Tom,

I guess I failed to read your previous post.

If you may, could you please expound on setting up an add-in?

Thanks in advance,

Virgil
 
Upvote 0

Forum statistics

Threads
1,224,559
Messages
6,179,517
Members
452,921
Latest member
BBQKING

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