LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #9   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 195
Default Print array based on menu choice

In case anyone's interested, here's the final product

Private Sub Workbook_Activate()
On Error Resume Next
Application.CommandBars(1).Controls("Signups").Del ete
Dim vDay, vDays
vDays = Array("Monday", "Tuesday", "Wednesday", "Thursday")
With Application.CommandBars("Worksheet Menu Bar")
With .Controls.Add(msoControlPopup)
..Caption = "Signups"
..BeginGroup = True
For Each vDay In vDays
With .Controls.Add(msoControlButton)
..Caption = vDay
..OnAction = "PrintToday"
End With
Next
End With
End With
End Sub

Private Sub Workbook_Deactivate()
On Error Resume Next
Application.CommandBars(1).Controls("Signups").Del ete
End Sub

Private Sub PrintToday()
With Application.CommandBars.ActionControl
Range("A1") = .Caption
End With
End Sub

Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Address < "$A$1" Then Exit Sub
On Error GoTo Quit
Dim MonArr, TueArr, WedArr, ThuArr, v, i As Long
MonArr = Array("Intermediate Computer", "Wellness", "Supported
Employment", "Understanding Your Medications", "Creative Writing",
"Picking Up The Pieces")
TueArr = Array("LIFTT", "Wellness", "WRAP", "Sign Language", "Beginning
Computer", "Anger Management")
WedArr = Array("Intermediate Computer", "Wellness", "Supported
Employment", "Understanding Your Symptoms", "WRAP", "Anger Management")
ThuArr = Array("Picking Up The Pieces", "Wellness", "LIFTT", "Adult Basic
Education", "Beginning Computer", "Creative Writing")
Select Case Target.Value
Case "Monday"
v = MonArr
Case "Tuesday"
v = TueArr
Case "Wednesday"
v = WedArr
Case "Thursday"
v = ThuArr
End Select
For i = LBound(v) To UBound(v)
Range("A1") = (v(i))
Select Case v(i)
Case "Beginning Computer", "Intermediate Computer", "Adult Basic
Education", "Creative Writing", "Sign Language"
Range("A14:A20").EntireRow.Hidden = True
Range("E11").Value = 4
Case Else
ActiveSheet.Rows.Hidden = False
Range("E11").Value = 11
End Select
ActiveSheet.UsedRange
ActiveSheet.PrintOut
Next i
Quit:
End Sub

Thanks again, Tom Ogilvy, for leading the way

--
David
 
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
Updating graphs based on choice in drop-down menu: tim_maciejewski Charts and Charting in Excel 1 March 2nd 09 04:45 AM
Updating graphs based on choice in drop-down menu: tim.maciejewski[_2_] Charts and Charting in Excel 0 March 2nd 09 12:41 AM
Updating graphs based on choice in drop-down menu: tim.maciejewski Charts and Charting in Excel 0 March 2nd 09 12:24 AM
Use dd menu choice to filter input for next ddm, etc. William DeLeo Excel Discussion (Misc queries) 6 June 12th 06 09:59 PM
Applying a formula to a drop menu choice Andrew Hill Excel Discussion (Misc queries) 1 January 4th 05 11:05 AM


All times are GMT +1. The time now is 06:51 AM.

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"