Computing.Net > Forums > Programming > Excel Macro

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

Excel Macro

Reply to Message Icon

Name: AlwaysWillingToLearn
Date: February 21, 2007 at 06:15:11 Pacific
OS: winxp
CPU/Ram: 512
Product: msi
Comment:

Hey,

im writting a macro in excel, i want it to display a number in range A1 in this format 0001 and then some condition will cause it to increment by one and therefore become 0002 and so one. but when i write this in the macro it only outputs 1 and omits the 000, how can i resolve this? i have tried to google number formatting and stuff likr that but cannot find a solution. any help would be much appreciated.

Thanks all.



Sponsored Link
Ads by Google

Response Number 1
Name: jon_k
Date: February 22, 2007 at 05:25:01 Pacific
Reply:

sheet1.range("A1").numberformat = "0000"

will resolve your problem, I think.


0

Response Number 2
Name: AlwaysWillingToLearn
Date: February 22, 2007 at 08:45:13 Pacific
Reply:

excellent mate nice one, works like a treat.

thanks again


0

Response Number 3
Name: Cosmo (by 0_Cosmo)
Date: April 10, 2007 at 07:34:34 Pacific
Reply:

Always, could I please get your macro? It sounds like exactly what I'm trying to do, and I'm stuck. I know I'm missing something really simple, I'm just brain dead right now. I'd really appreciate the help.

Thanks.

"Just because your children are born in the South doesn't make them Southerners. If your cat had kittens in the oven, it wouldn't make them biscuits."

Cosmo


0

Sponsored Link
Ads by Google
Reply to Message Icon

Related Posts

See More







Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Programming Forum Home


Sponsored links

Ads by Google


Results for: Excel Macro

Can I call an Excel macro from cell www.computing.net/answers/programming/can-i-call-an-excel-macro-from-cell/4812.html

Excel macro www.computing.net/answers/programming/excel-macro/9408.html

Excel Macro www.computing.net/answers/programming/excel-macro/14702.html