question

JonathanBrotto-3536 avatar image
0 Votes"
JonathanBrotto-3536 asked

Excel get years from date column

I am trying to select a column and next to it have the years show up. Copy this VBA code but not sure exactly if it will translate to VB.net

     Columns("C:C").Select
     Selection.NumberFormat = "m/d/yyyy"
     Range("C2").Select
     ActiveCell.FormulaR1C1 = "11/2/2020"
     Columns("D:D").Select
     Selection.Insert Shift:=xlToRight, CopyOrigin:=xlFormatFromLeftOrAbove
     Range("D2").Select
     Application.CutCopyMode = False
     ActiveCell.FormulaR1C1 = "=YEAR(RC[-1])"
     Columns("D:D").Select
dotnet-visual-basicoffice-vba-devoffice-scripts-excel-devoffice-vsto-com-dev
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

0 Answers