View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
GS[_2_] GS[_2_] is offline
external usenet poster
 
Posts: 3,514
Default Help needed to writing a macro to put the year in column B of a table using Table nomenclature & the Evaluate method

Try...

Sub Solution3()
Dim rng As Range
Set rng = Range("a2", Range("a" & Rows.Count).End(xlUp))
rng.Offset(, 1).Formula = "=year(a2)"
With rng.Offset(, 1)
.Value = .Value
End With
Set rng = Nothing
End Sub

--
Garry

Free usenet access at http://www.eternal-september.org
Classic VB Users Regroup!
comp.lang.basic.visual.misc
microsoft.public.vb.general.discussion