vba - Have Excel Check Cell format at every Change -


i have vba code helps users schedule projects entering either date or days until completion particular tasks , creates graph shows percent completion of project.

the vba code hinges on formatting of cell perform calculations. excel great job of choosing number or date correctly first time user inputs value. if user input date , decide input number (ex: 7) end 1/7/1900 date, makes excel perform vba incorrectly.

is there way excel "reconsider" formatting of cell each time changed? if not there way force in vba , choose either number or date formatting only?

thanks,

-mk

yes,

  1. as user prefixing "=" best bet.
  2. adding "e0" on end format ugly scientific number, @ least it's accurately represented in memory.
  3. another option multiplying 100 followed "%".

you've accurately noticed dates numbers don't change easily. on other hand entry front-slash '/' seems format date pretty reliably. single apostrophe ' formats text, not automated solutions. number general change numberformat, "automatic" solution non-standard.


Comments

Popular posts from this blog

Why can rails not find a route created by a helper? -

javascript - jquery or ashx not working -

opencv - DataType<cv::detail::deriv_type>::depth what is it used for -