Grouping Columns causing errors with other macros

Glove_Man

Well-known Member
Joined
Feb 20, 2005
Messages
578
G'Day all,

I have a macro which downloads some data into some pre-arranged cells and then formats some graphs which are linked to those cells.

Since I need to display the resultant graphs in a weekly presentation, I have grouped the columns where the data is downloaded (A to AB).

The idea is that I will hide the data when I make the presentation. However, if you run the macro with the columns hidden, you receive errors. When the columns are not hidden, you don't.

Essentially, what is the command that unhides the columns?

Is it something like:
Columns("A:AB").unhide
or
Groups("Group1").visible = true

Thanks

Philby
 

Excel Facts

Waterfall charts in Excel?
Office 365 customers have access to Waterfall charts since late 2016. They were added to Excel 2019.
Add your lines of code to ungroup your columns to your download and format code. Then at the end, add the lines of code to re-group your columns.
 
Upvote 0
I got it to work, thanks.

But does anyone know if there's a way to control the +/- buttons you get along the top of the spreadsheet from inside VBA?

Philby
 
Upvote 0
This code is for Grouping and ungrouping ROWs. Columns should be similar;
Code:
    ActiveSheet.Outline.ShowLevels RowLevels:=2
    ' or
    ActiveSheet.Outline.ShowLevels RowLevels:=1
 
Upvote 0

Forum statistics

Threads
1,222,227
Messages
6,164,716
Members
451,912
Latest member
HMF009

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