excel - VBA Append comma to end of integer, don't automatically change format -


my current project rewrite program written in 98. solution in excel, next part in word, , excel in 3rd step. program syncs 2 files, , solution dandy 20 files need sync - however, there around 1,000 files sync - i'm working on streamlining process. output files ranges between x.x , x.xxxxx - formatted them

columns("a:a").select selection.numberformat = "0.00000" 

to make file easier read. 2nd part append comma, , letter regarding numbers relation: not necessary question @ hand. when try append comma, excel attempts "fix" , outputs incorrectly. example:

0.42400

0.87200

1.31600

1.75200

becomes:

.424,

.872,

1.316,

1.752,

when should stay @ x.xxxxx. here have tried:

  • changing excel's options decimal identifier '.' , thousands ':'.
  • `range("a" & ictr) = format(range("a" & ictr) & ",")
  • selection.numberformat = "0.00000,"
  • other forums/google/bing

i'm assuming can done in excel, cannot find solution other re-opening word, , excel

any ideas?

since state the

2nd part append comma, , letter regarding numbers relation

you're going need formula, not formatting option. in vba code, select cells next original values, , add line of code:

selection.formular1c1 = "=text(rc[-1],""#0.00000"") & "",""" 

this gets formatting , comma (regardless of length of number left of decimal point) -- add last letter, you'll have modify formula meet specific needs.


Comments

Popular posts from this blog

Change php variable from jquery value using ajax (same page) -

Pull out data related to my apps from Android Play Store and iOS App Store -

How can I fetch data from a web server in an android application? -