Forum Discussion

Fchedraoui's avatar
Fchedraoui
Copper Contributor
Apr 05, 2022
Solved

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...
  • Fchedraoui's avatar
    Fchedraoui
    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

    HansVogelaar 

Resources