seannewtoexcel
New Member
- Joined
- Jul 28, 2011
- Messages
- 8
Hi, I'm new to VBA and posting on forums!! Trying to learn VBA and I have a few stupid questions which I hope someone can help me with, In relation to the below code for VBA:
If ActiveCell.Address <> "$A$1" Then
Dim tempstr As String
tempstr = ActiveCell.Address
If (Mid(tempstr, InStrRev(tempstr, "$") + 1, Len(tempstr)) > 1) And (Mid(tempstr, InStrRev(tempstr, "$") + 1, Len(tempstr)) < 42) Then
MsgBox ("Computer Says No")
Exit Sub
The ActiveCell.Address is (cell) $CP$40, I'm just curious is tempstr now $CP$40 and therefore Mid(tempstr, InStrRev(tempstr, "$") + 1, Len(tempstr)) would be Mid($CP$40,4,6), which would have to be = 0?
If ActiveCell.Address <> "$A$1" Then
Dim tempstr As String
tempstr = ActiveCell.Address
If (Mid(tempstr, InStrRev(tempstr, "$") + 1, Len(tempstr)) > 1) And (Mid(tempstr, InStrRev(tempstr, "$") + 1, Len(tempstr)) < 42) Then
MsgBox ("Computer Says No")
Exit Sub
The ActiveCell.Address is (cell) $CP$40, I'm just curious is tempstr now $CP$40 and therefore Mid(tempstr, InStrRev(tempstr, "$") + 1, Len(tempstr)) would be Mid($CP$40,4,6), which would have to be = 0?