This is my code:
Rang = Range("A" & ActiveCell.Row)
If Left(ActiveCell.Value, 3) = "INC" Or Left(Rang.Value, 3) = "INI" Then
r = ActiveCell.Value
ElseIf Rang.Hyperlinks.Count > 0 Then
r = Rang.Hyperlinks(1).Address
If Right(r, 6) = "%22%22" Then
r = Left(r, Len(r) - 3)
End If
Else
r = MsgBox("There is no record here.")
Exit Sub
End If
as you can see, I need to use the Range("A" & ActiveCell.Row) a few times (the code is much longer than this segment however its very similar), so i want to assign it to a variable so i can just use the shorter way of typing it (im lazy i guess)
Ive tried to set the variable Rang as a "Varient" and "Range" but neither works and i cant tell why...
If I assigned it to a fixed range (ie. A2:A20) and used a "For each Cell in Range" command, i know that would work, so why doesnt it work for a single cell?
Rang is set to a range and im pretty sure im using it correctly elsewhere but i cant figure out why it wont accept it?
anyone have any ideas?
Bookmarks