Reputation: 3
I wanted to copy the value of selected cell (ex. 2020/07/29) which is in date format and it will return only the year and month (2020/07). could anyone help me? thank you in advance
Upvotes: 0
Views: 1147
Reputation: 14383
Please try this.
Dim FileName As String
FileName = Format(ActiveCell.Value, "yy mmm")
Debug.Print FileName
Upvotes: 1