Autohide Specific Columns

crayzayone

New Member
Joined
Feb 17, 2015
Messages
2
I work with a specific spreadsheet daily... This spreadsheet is sent as a "new" spreadsheet each day to my email (company policy, even if it is slightly moronic lol) but since that is the case, I have to format each spreadsheet daily to get rid of the data I don't really need. I would appreciate if anybody can possibly think of a way I can AutoHide these columns without manually CTRL Click or Shift Clicking groups. I was thinking Macros, but I know that the macro wouldn't be saved on the new day's document. But these are the columns I need hid:

A/C/E-H/J-N/P-V/X-AB/AF-AU/BA-BX/CB-CL/CN-DO/DR-DX
 

Excel Facts

Format cells as currency
Select range and press Ctrl+Shift+4 to format cells as currency. (Shift 4 is the $ sign).
Welcome to the Board!

You can record a macro and choose to store it in your "Personal Macro Workbook". That way it will be available to call from any instance of Excel. You can also assign it a keyboard shortcut, just make sure not to assign a given key (like CTRL+Z)!

HTH,
 
Upvote 0
Welcome to the Board!

You can record a macro and choose to store it in your "Personal Macro Workbook". That way it will be available to call from any instance of Excel. You can also assign it a keyboard shortcut, just make sure not to assign a given key (like CTRL+Z)!

HTH,

Thank you! I appreciate the swift response... As I only know enough about creating macros to really screw them up, I'm really looking at macros from other posts that may be beneficial and trying to edit them for my use. for instance:

Option Explicit

Sub HideColumns(a,c,e:h,j:n,p:v,x:ab,af:au,ba:bx,cb:cl,cn:do,dr:dx)
Dim rng As Range
Dim c As Range

For Each c In Sheets("Sheet1").Range("G1:Z1")
If Len(c) = 0 Then
If rng Is Nothing Then
Set rng = c
Else
Set rng = Union(rng, c)
End If
End If
Next c
rng.EntireColumn.Hidden = True
End Sub

I found that code on another post and edited the ranges (I honestly don't know if that will even work lol that's how ignorant I am). All i want it to do is hide those specific columns, I don't need it to do anything else. I'm not sure what the "For each c in Sheets" part and below does but I didn't want to mess up the code so... If you could clarify I would appreciate it.
 
Upvote 0
Did you try recording a macro hiding those columns?

That will give you the code you need.
 
Upvote 0

Forum statistics

Threads
1,223,214
Messages
6,170,772
Members
452,353
Latest member
strainu

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