Change your code to...d = "=OFFSET...Without the second equal sign Excel interprets your entry as a simpletext entry.