Afternoon all
First and foremost, thank you for your help in advance. Greatly appreciate it.
I am building a workbook whereby I have a code in 4 worksheets that hides columns based on a value found in row 5.
The code in each of these worksheets is within their own sub and is as follows:
The results in Row 5 are all dependant on the answers provided in an alternative worksheet "Chart of Accounts".
I want to include a button that will refresh and run the macro on each of the 4 worksheets, so when any changes are made in "Chart of Accounts", the user can refresh each of the 4 worksheets.
Research suggests I need to use a 'module' however I got lost at this point.
If anybody could give assistance on the required code for this macro, that would be appreciated.
Thanks!
First and foremost, thank you for your help in advance. Greatly appreciate it.
I am building a workbook whereby I have a code in 4 worksheets that hides columns based on a value found in row 5.
The code in each of these worksheets is within their own sub and is as follows:
Code:
Sub Hide_Columns_Containing_Value()
Dim c As Range
For Each c In Range("B5:AS5").Cells
If c.Value = "xxx" Then
c.EntireColumn.Hidden = True
Else: c.EntireColumn.Hidden = False
End If
Next c
End Sub
The results in Row 5 are all dependant on the answers provided in an alternative worksheet "Chart of Accounts".
I want to include a button that will refresh and run the macro on each of the 4 worksheets, so when any changes are made in "Chart of Accounts", the user can refresh each of the 4 worksheets.
Research suggests I need to use a 'module' however I got lost at this point.
If anybody could give assistance on the required code for this macro, that would be appreciated.
Thanks!