Error in grouping rows in excel using VB

J

jpops23

Hi all-

Some code I used from a previous thread- this code allows a user to
double click a row to ungroup or group it. Works great, until you
double click a row that isn't grouped. I then get this error:

"Unable to set the Showdetail property of the Range class". Anyone know
of a way around this?

Here is the code I'm using in Excel 2002.

Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Excel.Range,
Cancel As Boolean)
Target.EntireRow.ShowDetail = Not Target.EntireRow.ShowDetail
End Sub

Thanks in advanced!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top