Is there a way to hide column but still show data in chart?

SereneSea

New Member
Joined
Feb 2, 2022
Messages
43
Office Version
  1. 2016
Platform
  1. Windows
Just thinking, is there a way or a macro of hiding a column but still have the data show in the chart created? (not a pivot table)?
 

Excel Facts

Will the fill handle fill 1, 2, 3?
Yes! Type 1 in a cell. Hold down Ctrl while you drag the fill handle.
hide is setting the columnwidth to 0.
So if you don't hide those columns but make their width for example 0.1 (=visual the same), they are still in your chart
With the boolean parameter in ShowColumns, you show or semi-hide certain columns.
You can call this macro in another macro
VBA Code:
Sub testColumns()
     ShowColumns True
     MsgBox "not hidden"
     ShowColumns False
     MsgBox "columns visual hidden"
     ShowColumns True
End Sub

Sub ShowColumns(b As Boolean)
     Columns("H:I").ColumnWidth = IIf(b, 10, 0.1)               'swap between columnwidth 10 and .1
End Sub
 
Last edited:
Upvote 0
Solution
Wow so simple, I totally forgot about actually setting a width, I have just been dragging it! Thanks!
 
Upvote 0

Forum statistics

Threads
1,215,028
Messages
6,122,753
Members
449,094
Latest member
dsharae57

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