Yumi Hamano
Yumi Hamano

Reputation: 3

Get Value of selected cell

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

Answers (1)

Variatus
Variatus

Reputation: 14383

Please try this.

Dim FileName As String

FileName = Format(ActiveCell.Value, "yy mmm")
Debug.Print FileName

Upvotes: 1

Related Questions