ShowDetail Unable To Set The ShowDetail Property

Lewzerrrr

Active Member
Joined
Jan 18, 2017
Messages
256
Hi,

I'm trying to test whether a group of columns is hidden or unhidden by grouping, if I was to use 2 statements such as Columns(2).ShowDetail = True and Columns(2).ShowDetail = False, it would open and close.. however when I try to test if one is True then False Else True it fails?

So if my column is hidden and my statement is:

Code:
            Colnum = ActiveCell.Offset(, -1).Column

                    If Columns(Colnum).ShowDetail = False Then


                    Columns(Colnum).ShowDetail = True
                    
                    Else
                    
                    Columns(Colnum).ShowDetail = False
                    
                    End If

It skips the first condition no matter what. Always going to the Else statement? How comes?

Thanks,
 

Excel Facts

Which came first: VisiCalc or Lotus 1-2-3?
Dan Bricklin and Bob Frankston debuted VisiCalc in 1979 as a Visible Calculator. Lotus 1-2-3 debuted in the early 1980's, from Mitch Kapor.
Solved with this but still unsure as to why that doesn't work :)

Code:
            ColNum = ActiveCell.Offset(, -8).Column            
                If Columns(ColNum).Resize(, ColNum + 8).Hidden = False Then
                    Columns(ColNum).Resize(, ColNum + 8).Hidden = True
                Else
                    Columns(ColNum).Resize(, ColNum + 8).Hidden = False
                End If
 
Upvote 0

Forum statistics

Threads
1,223,237
Messages
6,170,928
Members
452,366
Latest member
TePunaBloke

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