Forum Discussion
Fchedraoui
Apr 05, 2022Copper Contributor
VBA Range Format
VBA, F2:F99999 = date format = 18-sept-21 "Range("F2:F99999").Numberformat = "yyyy-mm-dd"" works and format come as 2021-09-18 as custom but then changes format after closing excel. when i reop...
- Apr 05, 2022
WAW nice! Bingo!
Explain.. :
.formula means what ?
the IF is an IF excel function? if so, then F2="""" is the logical test ? does it mean if empty? why 4 of "
then , """" means value if true? and then ,TEXT(F2,""yyy-mm-dd"") if value if false?
.Numberformat = "@" will format G column as TEXT
.value (G2) = .value (F2) <-- how does it know this is F2 ?
end with (end loop)
sorry for all the questions but i want to understand it.
Thank you so much
PeterBartholomew1
Apr 05, 2022Silver Contributor
Sorry HansVogelaar , still showed as no replies when I started.
Fchedraoui Are you sure about the apostrophe "'"? Excel normally ignores it but, as Hans suggests the text number format "@" should also work.