Select Change VBA unhiding hidden column

The_Steward

Board Regular
Joined
Nov 26, 2020
Messages
63
Office Version
  1. 365
Platform
  1. Windows
I am using select change to change column width and remove text but when I click a different cell it unhides my hidden column that I put my hyperlinks in. Why is this happening?

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Target.Count > 1 Then Exit Sub
If Target.Address = "$G$12" Then
Target.Columns.ColumnWidth = 50
Else
Columns.ColumnWidth = 15
End If

If Target.Count > 1 Then Exit Sub
If Target.Address = "$G$12" Then
Target.Cells.Value = ""
End If
 

Excel Facts

Why are there 1,048,576 rows in Excel?
The Excel team increased the size of the grid in 2007. There are 2^20 rows and 2^14 columns for a total of 17 billion cells.
Hello Peter I now have the issue on this sheet of the hidden row becoming unhidden when I click one of the hyperlinks on the sheet. I have several other sheets with the same hyperlink and VBA attached to these links but the sheet in question above is the only one doing and I can't figure out why, any suggestions?
 
Upvote 0
Nothing about hidden rows before? Details?


Nothing about hyperlinks before? Details?

What does this have to do with G12?
Sorry Hidden Column, Column A. I have Hyperlinks in Columns B and C. From doing some testing I have realised this only occurs when it is an unprotected sheet. So not realistically not an issue for my users thankfully. Still not sure why it does this though. Has nothing do with G12 as far as I am aware.

Please see image for further details.
 

Attachments

  • Unhidden Row.JPG
    Unhidden Row.JPG
    171.6 KB · Views: 4
Upvote 0
Has nothing do with G12 as far as I am aware.
The code we started with in post 1 was all about G12 & there has been nothing since to say otherwise. ;)


So not realistically not an issue for my users thankfully.
A lot of "not"s there. Does that mean you are right to go?


Edit: And there was mention of hyperlinks earlier - my mistake, sorry. :oops:
But they were not mentioned/used in the code. :)
 
Upvote 0
Yes all good to go thankyou! Back then it was all about G12 but thanks to your keen eye that was sorted. Sorry for the confusion.
 
Upvote 0

Forum statistics

Threads
1,215,248
Messages
6,123,869
Members
449,130
Latest member
lolasmith

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