LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 85
Default Printing Assembled Array Using Sheet Names

I have a VB sheet that has multiple (in the example below I have 3) different
check boxes. When the user checks the different boxes and then presses a
button on the form I want to assemble the different Sheets (named as
ShtNumber1, ShtNumber2 and ShtNumber3) below into a print array. I have
tried this multiple ways and can get it to work if it is hard-coded to the
equivalent of this assembled array, but it will not print.

Please notice that I am appending a ", " on the end of each selected sheet
name, so at the end of this code I trim it off of the end .

Any help or better way to accomplish this would be greatly appreciated.
Thank you.


Dim PrintArray As String
Dim ArrayLength As Integer

'Set to array to blank
PrintArray = ""

'Check the individual values for true
' If CheckBox1 = True Then
PrintArray = PrintArray & "ShtNumber1.Name, "
' End If

' If CheckBox2 = True Then
PrintArray = PrintArray & "ShtNumber2.Name, "
' End If

' If CheckBox3 = True Then
' PrintArray = PrintArray & "ShtNumber2.Name, "
' End If

ArrayLength = Len(PrintArray)

If ArrayLength 2 Then

€˜Gets rid of comma and space

PrintArray = Left(PrintArray, ArrayLength - 2)

Else

End If

Sheets(Array(PrintArray)).Select

ActiveWindow.SelectedSheets.PrintOut

 
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
XL2007 and array of sheet names? Jack Sheet Excel Discussion (Misc queries) 0 August 5th 06 02:57 PM
Passing sheet names to an array ExcelMonkey Excel Programming 3 March 23rd 06 10:07 AM
Array of all selected sheet names? quartz[_2_] Excel Programming 13 October 5th 05 08:52 AM
printing sheet names Shooter Excel Worksheet Functions 2 December 9th 04 03:19 PM
Sheet Names Array Rocky McKinley Excel Programming 2 June 9th 04 11:49 PM


All times are GMT +1. The time now is 11:34 PM.

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

About Us

"It's about Microsoft Excel"