in my VBA code I'm saving a variable as string because I need this to be open to text - numbers - date like numbers. I then need to copy this into a table.
When copying the first time the variable stays in text but the second time it goes into number format if the text is something that resembles a date (e.g. "11-2023" gets copied into "45231").
It seems that my variable is saved as "45231" form this point forward.
How can I force the variable value to stay in "11-2023" style?
THX!
I try formatting the column as text, doesn't work.
I try formatting the column as text- do that before copying, not after.ThisWorkbook.Sheets("Sheet1").ListObjects("Table1").ListColumns("ID").DataBodyRange.NumberFormat = "@".