You are here:

Excel/Comma between values when value is 100 and above

Advertisement


Question
Successor macro
Successor macro  

Successor
Successor  
"I have a macro (see image "Successor Macro") which works OK when in cell(s) “A” the value is lower than 100. Example: when there are multiple values which the macro collects, then I get perfectly 90,93,95, 97

But when the value in cell(s) “A” have a value of 100 and above then the macro will not put a comma anymore between each value: All the values will be put at “together”  See image: "Successor" : In this image you see that when I hit the "ID" button (W7) all the successors ID will be collect. For the deliverable's 1- till 5 the macro puts nicely a comma between the different values (W15). But in cell W24 the macro don't put comma's between the values anymore.

Answer
That's because 93,95,97 (whatever) can't be interpreted as a "real" number - it's clearly text.
But 100,101,102 etc looks like a real number: 100 million, 101 thousand 102.
Solution: Put a leading single quote before the string. That is, start Hold off as "'".
Should work fine.
(If you have a cell formatted as 0 and enter 100,101,102,103 you'll see th commas disappear).
About Excel
This topic answers questions related to Microsoft Excel spreadsheet (or workbook) stand-alone or Mircrosoft Office Excel including Excel 2003, Excel 2007, Office 2000, and Office XP. You can get Excel help on Excel formulas(or functions), Excell macros, charting in Excel, advanced features, and the general use of Excel. This does not provide a general Excel tutorial nor the basics of using a spreadsheet. It provides specific answers to using Microsoft Excel only. If you do not see your Excel question answered in this area then please ask an Excel question here

Excel

All Answers


Answers by Expert:


Ask Experts

Volunteer


Bob Umlas

Expertise

I`m a Microsoft Excel MVP (Most Valuable Professional) and have been since the inception of the program in 1995. I can answer every kind of Excel question except: API, Importing/exporting to other programs (powerpoint, word,...) Also check out my in-person training link at http://www.thumbtack.com/ny/new-york/excel-training/

Experience

Worked with MS Excel since version 0.99 (on the Mac!). Was contributing editor to Excellence Magazine, having written >300 articles. John Walkenbach said of me "I finally met someone who knows as much about Excel as I do."

Publications
Excellence, The Expert, Microsoft

Education/Credentials
BA in math, Hofstra University, 1965

Awards and Honors
MVP
Led sessions for the Convergence 2004-2006 seminar on Excel tips & tricks

©2016 About.com. All rights reserved.