Hi
I’ve managed to use VBA to hide columns in a worksheet that aren’t equal to a cell value, leaving a number of columns visible within the larger range.
LastColumn = 300 'Last Column
For i = 5 To LastColumn 'Looping through each Column, from column E(5)
'Hide all the columns with the values as 0 in Row 2
If Cells(2, i) <> Range("C1") And Cells(2, i) <> "" Then Columns(i).EntireColumn.Hidden = True
Next
What I need a pointer on is how to select each column that remains visible within the range in order to loop through the columns individually to tally up some data below each one(I think I’ve sorted code for this). There will on occasions be more than one visible column within the range.
Thanks in advance
I’ve managed to use VBA to hide columns in a worksheet that aren’t equal to a cell value, leaving a number of columns visible within the larger range.
LastColumn = 300 'Last Column
For i = 5 To LastColumn 'Looping through each Column, from column E(5)
'Hide all the columns with the values as 0 in Row 2
If Cells(2, i) <> Range("C1") And Cells(2, i) <> "" Then Columns(i).EntireColumn.Hidden = True
Next
What I need a pointer on is how to select each column that remains visible within the range in order to loop through the columns individually to tally up some data below each one(I think I’ve sorted code for this). There will on occasions be more than one visible column within the range.
Thanks in advance