Cell value is giving date instead of 1/10

Viewed 38

I am trying to number my excel sheets in custom order using vba

ThisWorkBook.Sheets(1).Range("A28").Value = "1/" & LstSheet

But it is showing 13 Jan instead of 1/13

How to keep cell value as 1/13 using vba.

1 Answers

Excel is "smart" and can read a date when it sees it, so try forcing to text:

ThisWorkBook.Sheets(1).Range("A28").Value = "'1/" & LstSheet
Related