sherifhanna
03-04-2017, 07:56 AM
Greetings Friends,
I'm writing a Sub to swap cells values. I'm accounting for a range of errors the user may commit, one of which is having more than one sheet selected.
However, I'm not sure how to test for that condition.
I'm thinking of something along the lines of the "Count" property of the cells range, but can't figure it out.
To give you an example of what I'm trying to do, here's how I'm picturing the code:
If [condition: selected sheets > 1] Then
MsgBox "You've selected too many sheets" & vbNewLine & "Please select one sheet"
End If
Exit Sub
I need help figuring out how to account for that condition in VBA language.
Please and thank you so much
S.
I'm writing a Sub to swap cells values. I'm accounting for a range of errors the user may commit, one of which is having more than one sheet selected.
However, I'm not sure how to test for that condition.
I'm thinking of something along the lines of the "Count" property of the cells range, but can't figure it out.
To give you an example of what I'm trying to do, here's how I'm picturing the code:
If [condition: selected sheets > 1] Then
MsgBox "You've selected too many sheets" & vbNewLine & "Please select one sheet"
End If
Exit Sub
I need help figuring out how to account for that condition in VBA language.
Please and thank you so much
S.