Error ONLY when double-clicking Cat9 - RT error 91

jim may

Well-known Member
Joined
Jul 4, 2004
Messages
7,486
This code works fine when I double click on Cat1 through Cat8; But I get R/T 91 - ERROR ONLY
when I double-click on Cat9 (Only). What could be my problem?

TIA, Jim

Rich (BB code):
Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean)
Dim MyMacro
Cancel = True
MyMacro = Target.Value
Select Case MyMacro
    Case "Cat1"
        ActiveSheet.ListObjects("Table1").Range.Select
    Case "Cat2"
        ActiveSheet.ListObjects("Table1").HeaderRowRange.Select
    Case "Cat3"
        ActiveSheet.ListObjects("Table1").DataBodyRange.Select
    Case "Cat4"
        ActiveSheet.ListObjects("Table1").ListColumns(3).Range.Select 
    Case "Cat5"
        ActiveSheet.ListObjects("Table1").ListColumns(3).DataBodyRange.Select
    Case "Cat6"
        ActiveSheet.ListObjects("Table1").ListRows(4).Range.Select
    Case "Cat7"
        ActiveSheet.ListObjects("Table1").HeaderRowRange(3).Select
    Case "Cat8"
        ActiveSheet.ListObjects("Table1").DataBodyRange(3, 2).Select
    Case "Cat9"
        ActiveSheet.ListObjects("Table1").TotalsRowRange.Select  << This Line HIGHLIGHT with Yellow After Debug
    Case Else
    'Do Nothing
End Select
End Sub
 
Last edited:

Excel Facts

Workdays for a market open Mon, Wed, Friday?
Yes! Use "0101011" for the weekend argument in NETWORKDAYS.INTL or WORKDAY.INTL. The 7 digits start on Monday. 1 means it is a weekend.
Does Table1 have a totals row?
 
Upvote 0

Forum statistics

Threads
1,215,558
Messages
6,125,511
Members
449,236
Latest member
Afua

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top