Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Why Type Mismatch error
The following prints out sheets as desired based on menu choice, but
without On Error line bombs immediately with 'Type Mismatch' at indicated line: Private Sub Worksheet_Change(ByVal Target As Range) If Target.Address < "$A$1" Then Exit Sub On Error GoTo Quit '<-- Without this it bombs where indicated below 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 Case "Friday" Range("A1") = "Wellness" GoTo Units End Select For i = LBound(v) To UBound(v) '<-- Type Mismatch points here 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 Units: Sheets(2).Visible = True With Sheets(2) ..Range("A1") = "Maintenance Signups": .PrintOut ..Range("A1") = "Food Service Signups": .PrintOut End With Sheets(2).Visible = False Quit: End Sub How to prevent it so I can remove On Error -- David |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Visual Basic Error Run Time Error, Type Mismatch | Excel Discussion (Misc queries) | |||
Type Mismatch Error | Excel Programming | |||
Befuddled with For Next Loop ------ Run - Time Error '13' Type Mismatch Error | Excel Programming | |||
help with type mismatch error | Excel Programming | |||
Type Mismatch Error Need Help | Excel Programming |