Hi I'm working with these kind of repeated codes.
Private Sub Cmd1_Click()
With Sheets("sheet1")
.Activate
.Visible = True
End With
End Sub
Private Sub Cmd2_Click()
With Sheets("sheet2")
.Activate
.Visible = True
End With
End Sub
...
Private Sub Cmd200_Click()
With Sheets("sheet200")
.Activate
.Visible = True
End With
End Sub
I'm doing this from Cmd1 to Cmd200 on my own!
Now I'm trying to seek a FANCY way to contract these codes.
I think stuff like "For i = 1 to 200" would be effective for this.
But i don't know how...
Could you give me a solution?
Thank you in advance!
Private Sub Cmd1_Click()
With Sheets("sheet1")
.Activate
.Visible = True
End With
End Sub
Private Sub Cmd2_Click()
With Sheets("sheet2")
.Activate
.Visible = True
End With
End Sub
...
Private Sub Cmd200_Click()
With Sheets("sheet200")
.Activate
.Visible = True
End With
End Sub
I'm doing this from Cmd1 to Cmd200 on my own!
Now I'm trying to seek a FANCY way to contract these codes.
I think stuff like "For i = 1 to 200" would be effective for this.
But i don't know how...
Could you give me a solution?
Thank you in advance!
