Macro I can add to the end of my pasting macro That will hide Column A on all tabs

Johnny Thunder

Well-known Member
Joined
Apr 9, 2010
Messages
693
Office Version
  1. 2016
Platform
  1. MacOS
Hello All,


I have a running macro that copies/Paste data from "Report_Paste" tab to about 12 tabs, at the end of the macro I would like the last piece of the script to say Hide Coulmn A from all tabs except the "Report_Paste" tab. Any ideas?

I use the record macro button to record the code and highlight all tabs and then hide column A but it only seems to hide it in one specific tab?

I am using Excel 2007
 

Excel Facts

Show numbers in thousands?
Use a custom number format of #,##0,K. Each comma after the final 0 will divide the displayed number by another thousand
Hi,

Maybe something like this;

Code:
    Dim ws As Worksheet
    
    For Each ws In ThisWorkbook.Worksheets
        ws.Columns("A").Hidden = True
    Next ws

Place the Dim at the top of your sub and the rest at the bottom.
 
Upvote 0
Hey Mike,

The code worked great! Thanks!


Now you have sparked a new question, I am going to write another post but I will write it her as well.

I need a macro to put at the end of the code you just gave me that will look through all tabs and go to column F and go down to the last cell with data and do an auto sum upwards to F3 and copy this formula (Sum) along the last line of data all the way to Column Q. Any ideas?
 
Upvote 0

Forum statistics

Threads
1,215,004
Messages
6,122,659
Members
449,091
Latest member
peppernaut

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