Jacques Labuschagne
Board Regular
- Joined
- Feb 5, 2012
- Messages
- 58
Hi
Hope somebody can help, I'm trying to define a a range that I will be using throughout the program, but the would like to add the Range as a shorter variable. but for some reason this is not working, can somebody please tell me where I'm going wrong?
Regards,
Jacques.
Hope somebody can help, I'm trying to define a a range that I will be using throughout the program, but the would like to add the Range as a shorter variable. but for some reason this is not working, can somebody please tell me where I'm going wrong?
Code:
Sub MainCall()
Dim inOut As Boolean
Dim user As Integer
Dim ws As Worksheet
Dim rgIO As Range 'Define Log in or Log Out
Set ws = Worksheets("Summary")
Set rgIO = Range("Z2").Value
If ws.rgIO.rgIO = "1" Then 'User logging in
'Call Log_In
MsgBox "User Log in"
ElseIf ws.rgIO = "2" Then
'Call Log_Out
MsgBox "User Log out"
End If
End Sub
Regards,
Jacques.