Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
cbm cbm is offline
external usenet poster
 
Posts: 13
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10,124
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10,124
Default 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   Report Post  
Posted to microsoft.public.excel.programming
cbm cbm is offline
external usenet poster
 
Posts: 13
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
How can I print the names of all the sheets in a list? SUN Excel Discussion (Misc queries) 1 October 7th 09 08:43 AM
Print list of names of all sheets in a workbook Jo Excel Discussion (Misc queries) 1 September 24th 09 05:00 PM
How to Print Name's list and Names Range? Excel_Oz Excel Worksheet Functions 3 March 29th 07 02:03 AM
Print range names and how know if have too many? John Excel Worksheet Functions 3 January 16th 06 06:44 PM
copy sheet1 and name sheets using names from a range DL[_3_] Excel Programming 2 September 2nd 03 12:58 PM


All times are GMT +1. The time now is 09:44 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"