Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi,
Is it possible to print a named range of data excel (the data is in a hidden sheet) My named ranges are "Filtered_Data" which is in the "Working" sheet and "Data_Table" which is in a hidden sheet called "Data", depending on what a listbox row source is I want to print one or these ranges to a default printer. My code is below: Private Sub cmd_print_Click() Dim Response As VbMsgBoxResult If ListBox2.RowSource = "Filtered_Data" Then 'code here to print "Filtered_Data" range Else Response = MsgBox("No data has been filtered, do you want to print all data?", vbQuestion + vbYesNo) If Response = vbNo Then Exit Sub 'code here to print "Data_Table" range MsgBox "All data has been sent to the printer.", vbInformation End If End Sub Any help would be greatly appreciated! Rachel |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Private Sub cmd_print_Click()
Dim Response As VbMsgBoxResult If ListBox2.RowSource = "Filtered_Data" Then 'code here to print "Filtered_Data" range Range("Filtered_Data").PrintOut Copies:=1, Collate:=True Else Response = MsgBox("No data has been filtered, do you want to print all data?", vbQuestion + vbYesNo) If Response = vbNo Then Exit Sub 'code here to print "Data_Table" range Sheets("Data").Visible = True Range("Data_Table").PrintOut Copies:=1, Collate:=True Sheets("Data").Visible = False MsgBox "All data has been sent to the printer.", vbInformation End If End Sub Regards, Stefi |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Macro to Show (and Print) Only Named Range? | Excel Discussion (Misc queries) | |||
Copy, Paste and Print Cells from a Named Range | Excel Programming | |||
Print Named Cells highlights web link to Excel range | Excel Discussion (Misc queries) | |||
Named Range DTS Import of Excel Data | Excel Discussion (Misc queries) | |||
how do I print a named dynamic range | Excel Programming |