Here is a picture of my spreadsheet and what I am trying to figure out how to get it to do what I need it to do:
The selected row (row 5) shows some cells that contain either a value of either "R" or "E". I need a If statement that checks a range of: Range(Cells(5, 6), Cells(5, lCol)), but only looks at visible cells(!)... not any cells(columns) that happen to be hidden at the time the code is executed.
There can be 3 possible out comes;
(1) If any ANY of the visible cells inside the range listed above it finds an "E", then (runs a macro for that outcome.)
(2) If any ANY of the visible cells inside the range listed above it finds an "R", then (runs a macro for that outcome.)
(3) If any ANY of the visible cells inside the range listed above it finds an "E" AND a "R", then (runs a macro for that outcome.)
Why I need this; This is a training matrix that keeps track of employees and what SOPs or documents that they have been trained for. The R and the E represent 2 different facilities. Depending on what is selected and currently being shown on the screen, it may be showing employees from 1 facility or another one, or a combination of both. Currently, I have 2 tabs on the spreadsheet representing our 2 facilities, but I want to integrate both of them together on 1 sheet, but I will still need a way to separate them for certain functions the various command buttons are scripted for. (hope that makes sense.) This is the only way I can think of that I could do this.... (but... was hoping someone else on here who is much smarter me might be able to suggest a better way, if there is one. )
Thanks!
The selected row (row 5) shows some cells that contain either a value of either "R" or "E". I need a If statement that checks a range of: Range(Cells(5, 6), Cells(5, lCol)), but only looks at visible cells(!)... not any cells(columns) that happen to be hidden at the time the code is executed.
There can be 3 possible out comes;
(1) If any ANY of the visible cells inside the range listed above it finds an "E", then (runs a macro for that outcome.)
(2) If any ANY of the visible cells inside the range listed above it finds an "R", then (runs a macro for that outcome.)
(3) If any ANY of the visible cells inside the range listed above it finds an "E" AND a "R", then (runs a macro for that outcome.)
Why I need this; This is a training matrix that keeps track of employees and what SOPs or documents that they have been trained for. The R and the E represent 2 different facilities. Depending on what is selected and currently being shown on the screen, it may be showing employees from 1 facility or another one, or a combination of both. Currently, I have 2 tabs on the spreadsheet representing our 2 facilities, but I want to integrate both of them together on 1 sheet, but I will still need a way to separate them for certain functions the various command buttons are scripted for. (hope that makes sense.) This is the only way I can think of that I could do this.... (but... was hoping someone else on here who is much smarter me might be able to suggest a better way, if there is one. )
Thanks!