Macro hide columns into several sheets?

patrick89

New Member
Joined
Mar 31, 2011
Messages
2
Hi all!

I m intern and I need juste a piece of your experience to make it working...!

To sum up, I'd like to hide a column (D to F for instance) on several sheets. (sheets 1 to 5)
I tried almost all the possibilities thanks to VBA online but I m really novice and nothing s working so far...

(for example 1 of the code I tried but not working:
Sub Macro20()
'
' Macro20 Macro
'

'
Sheets(Array("Sheet1", "Sheet2", "Sheet3", "Sheet4", "Sheet5")).Select
Sheets("Sheet5").Activate
Columns("D:F").Select
Selection.EntireColumn.Hidden = True
End Sub)


Thanks a loooot for your help and hope I made it clear..

Patrick
 

Excel Facts

Round to nearest half hour?
Use =MROUND(A2,"0:30") to round to nearest half hour. Use =CEILING(A2,"0:30") to round to next half hour.
Sub Macro20()
For Each x In Array("Sheet1", "Sheet2", "Sheet3", "Sheet4", "Sheet5")
Sheets(x).Columns("D:F").EntireColumn.Hidden = True
Next
End Sub
 
Upvote 0

Forum statistics

Threads
1,224,524
Messages
6,179,310
Members
452,906
Latest member
phanmemchatdakenhupviral

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