Copy Date on Excel Tab to Cell In Spreadsheet and Add Year, How?

A

aep002

I work on bank reconciliations and the tabs say "7-19", "7-18" etc.
Figured out how to auto copy the tab data but how can I add to it so it
reads "7-19-06"?

THANKS!!!
 
S

Steel Monkey

Try This
Change the range to where you want the date displayed

Sub getname()
Dim name As Date
name = ActiveSheet.name
Range("D26").Select
ActiveCell.Value = name
ActiveCell.Select
Selection.NumberFormat = "d-mmm-yy"
End Sub

if i have misunderstood what you wanted let me know
 
S

Steel Monkey

Try This
Change the range to where you want the date displayed

Sub getname()
Dim name As Date
name = ActiveSheet.name
Range("D26").Select
ActiveCell.Value = name
ActiveCell.Select
Selection.NumberFormat = "d-mmm-yy"
End Sub

if i have misunderstood what you wanted let me know!
 
A

aep002

I can't use macros the bank doesn't like it. I tried formatting the
field as dd/mm/yy but it doesn't add the year when i copy the tab value
of "7-19".
 
Top