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

Back into an answer in Excel
Use Data, What-If Analysis, Goal Seek to find the correct input cell value to reach a desired result
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,909
Messages
6,175,312
Members
452,634
Latest member
cpostell

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