Sandcastor
Board Regular
- Joined
- May 14, 2012
- Messages
- 97
I Have:
A table that I use as a log sheet which currently has 29 columns (I sometimes add more), and over 500 rows (adding more all the time).
It is used to log samples that our clients bring in. The first few column headers are like so:
Company, Location, Job ID, Sample Numbers, Sample date Range, Date Received, Date shipped out, Tracking #, Samples Billed, Samples remain
I use the log for a few different functions like collecting information for various reports, and for guiding me in when to discard samples and such. To make these jobs easier, I hide certain groups of columns. Macros like the following help with that:
This works, but I occasionally add a column or take one out.
I could do a FOR EACH NEXT to iterate through each cell and test each value individually, but that means 29^2 checks. Very slow and hard to update with new criteria.
I need something to check the value of a cell, compare it to a list, and hide if true. Plain-language code:
Any Ideas?
A table that I use as a log sheet which currently has 29 columns (I sometimes add more), and over 500 rows (adding more all the time).
It is used to log samples that our clients bring in. The first few column headers are like so:
Company, Location, Job ID, Sample Numbers, Sample date Range, Date Received, Date shipped out, Tracking #, Samples Billed, Samples remain
I use the log for a few different functions like collecting information for various reports, and for guiding me in when to discard samples and such. To make these jobs easier, I hide certain groups of columns. Macros like the following help with that:
Code:
Sub UploadMode()'
Application.ScreenUpdating = False
Range("E:F,J:L,Q:S").EntireColumn.Hidden = True
Application.ScreenUpdating = True
End Sub
This works, but I occasionally add a column or take one out.
I could do a FOR EACH NEXT to iterate through each cell and test each value individually, but that means 29^2 checks. Very slow and hard to update with new criteria.
I need something to check the value of a cell, compare it to a list, and hide if true. Plain-language code:
Code:
Define a list of values based on some of the header values
FOR EACH cell in range.(“Headers”)
Check cell value against the list and if true then EntireColumn.Hidden = True
NEXT
Any Ideas?
Last edited: