Gilbfernandes
New Member
- Joined
- Jan 26, 2016
- Messages
- 20
Hi everyone, I have a routine that runs more or less like this: In a Userform I have 30 Frames with CommandBotton inside. I want the routine to run From Range A1 to A30 of a sheet and if there is a 1 on that cell it means the cell is Active and the correspondent Frame on the USerForm should have a Capiton "Active".
I don’t want to do a IF-End IF lines checking the Cell and them changing the Frame Caption. If I do this I would have to have 30 lines, like
If Range(“a1”)=1 them Userform1.Frame1.Caption="Active"
.
.
.
I Would like to do something like:
For i = 1 to 30
If Range("a" & i)=1 them Userform1.Frame& i.Caption="Active"
Next i
I know this is not possible because I tried and there was an error, because of the attributes of Userform1.Frames
Does anyone have an idea?
I don’t want to do a IF-End IF lines checking the Cell and them changing the Frame Caption. If I do this I would have to have 30 lines, like
If Range(“a1”)=1 them Userform1.Frame1.Caption="Active"
.
.
.
I Would like to do something like:
For i = 1 to 30
If Range("a" & i)=1 them Userform1.Frame& i.Caption="Active"
Next i
I know this is not possible because I tried and there was an error, because of the attributes of Userform1.Frames
Does anyone have an idea?