Livin404
Well-known Member
- Joined
- Jan 7, 2019
- Messages
- 774
- Office Version
- 365
- 2019
- Platform
- Windows
Mr. Excel Member Stephen Crump has helped me tremendously. I think the code I do have is somehow erasing the formula I have in Column E. The formula I have is.
The code I think may be changing the formula to a value is
I am so sorry for all of this.
Excel Formula:
=IFERROR(VLOOKUP($D2,'State Country Code'!$A$2:$B$10388,2,0),"").
The code I think may be changing the formula to a value is
VBA Code:
Sub Location()
Application.EnableEvents = False
With Range(Range("E2"), Range("E2").End(xlDown))
.Offset(, 1).Value = Evaluate("IF(LEN(" & .Address & ")=2," & .Address & ","""")")
.Value = Evaluate("IF(LEN(" & .Address & ")=3," & .Address & ","""")")
End With
Application.EnableEvents = True
End Sub
I am so sorry for all of this.