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
673
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
 

Some videos you may like

Excel Facts

Which Excel functions can ignore hidden rows?
The SUBTOTAL and AGGREGATE functions ignore hidden rows. AGGREGATE can also exclude error cells and more.

Mike Blackman

Well-known Member
Joined
Jun 8, 2007
Messages
2,494
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.
 

Johnny Thunder

Well-known Member
Joined
Apr 9, 2010
Messages
673
Office Version
  1. 2016
Platform
  1. MacOS
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?
 

Watch MrExcel Video

Forum statistics

Threads
1,109,004
Messages
5,526,228
Members
409,689
Latest member
martin_br

This Week's Hot Topics

Top