Happy festive season hope you've all had a good one.
I have written some code which returns a cell reference to a
particular cell (an1). I am now trying to cause another cell on another ws to fill with the contents of a cell from the
original ws provided an "a" is in the offset(0,-1). I can get it to work but it gives me the contents of the offset cell an1
and not the value of that cell which is in fact $c$436.
During debug the value of myAddress shows as $C$436 but actually takes the contents of the offset AN1.
My attempt at code is below.
And a prosperous New Year
Private Sub NameEntry()
Dim myAddress As Range
Dim wsDaily As Worksheet
Dim wsFirst As Worksheet
Set wsFirst = Sheets("MAR First Visit")
Set wsDaily = Sheets("Daily Visits Mar")
Set myAddress = wsDaily.Range("an1")
If myAddress.Offset(0, -1) = "a" Then
wsFirst.Range("c5").Value = myAddress.Offset(0, 1).Value
If you like these VB formatting tags please consider sponsoring the author in support of injured Royal Marines