Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
print sheets from a range with names
I´ve got a list of certain sheet name´s and i need a command button
to print or preview only that sheets. Example: a1 Sheet3 a2 Sheet7 a3 Sheet10 .... Any idea??? Thanks a lot |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
print sheets from a range with names
Sub printsheets()
With Worksheets("sheet1") Set rng = .Range("A2:A5") End With For Each c In rng Set sh = Worksheets(c.Value) sh.PrintPreview Next End Sub -- Don Guillett SalesAid Software "cbm" wrote in message ups.com... I´ve got a list of certain sheet name´s and i need a command button to print or preview only that sheets. Example: a1 Sheet3 a2 Sheet7 a3 Sheet10 .... Any idea??? Thanks a lot |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
print sheets from a range with names
Or shorter
Sub doshts() For Each c In Sheets("sheet1").Range("a2:a3") Worksheets(c.Value).PrintPreview Next c End Sub -- Don Guillett SalesAid Software "cbm" wrote in message ups.com... I´ve got a list of certain sheet name´s and i need a command button to print or preview only that sheets. Example: a1 Sheet3 a2 Sheet7 a3 Sheet10 .... Any idea??? Thanks a lot |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
print sheets from a range with names
THANKS A LOT, DON!!! Great job.
WORKS PERFECT. As names came from a formula, i addapted it as: Private Sub CommandButton2_Click() Range("FJ1").Select Range(Selection, Selection.End(xlDown)).Select Selection.Copy Range("FK1").Select Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _ :=False, Transpose:=False Application.CutCopyMode = False Selection.Sort Key1:=Range("FK1"), Order1:=xlDescending, Header:=xlGuess _ , OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom, _ DataOption1:=xlSortNormal Range("d1021").Select For Each c In Sheets("Est").Range("fk1:fk1000") On Error Resume Next Worksheets(c.Value).PrintPreview Next c End Sub Don Guillett ha escrito: Or shorter Sub doshts() For Each c In Sheets("sheet1").Range("a2:a3") Worksheets(c.Value).PrintPreview Next c End Sub -- Don Guillett SalesAid Software "cbm" wrote in message ups.com... I´ve got a list of certain sheet name´s and i need a command button to print or preview only that sheets. Example: a1 Sheet3 a2 Sheet7 a3 Sheet10 ... Any idea??? Thanks a lot |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
How can I print the names of all the sheets in a list? | Excel Discussion (Misc queries) | |||
Print list of names of all sheets in a workbook | Excel Discussion (Misc queries) | |||
How to Print Name's list and Names Range? | Excel Worksheet Functions | |||
Print range names and how know if have too many? | Excel Worksheet Functions | |||
copy sheet1 and name sheets using names from a range | Excel Programming |