LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
raj raj is offline
external usenet poster
 
Posts: 32
Default Value padding in VBA

Hello. Please help me if possible.

I need a function that will take a value that may be 1 to
3 digits in length and 0 to 2 decimal places and pad it to
always have three digits and two decimals.

For example:

1 would be converted to 001.00
14 would be converted to 014.00
15.3 would be converted to 015.30
145 would be converted to 145.00
197.21 would remain 197.21

The variable(s) can be strings if needed, I can work with
any VBA compatible datatype.

Your example code to do this would be most appreciated.
Thanks in advance for your assistance.
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Cell padding Jennifer Excel Discussion (Misc queries) 1 December 3rd 09 10:37 PM
How to Change the Cell Padding Pascal.H Excel Discussion (Misc queries) 1 May 30th 08 01:04 AM
Padding and Concatenate Static Excel Discussion (Misc queries) 2 November 2nd 07 07:40 PM
Padding with leading zeros GKW in GA Excel Discussion (Misc queries) 2 July 4th 07 12:42 AM
padding ? vbastarter Excel Discussion (Misc queries) 2 March 7th 06 12:11 PM


All times are GMT +1. The time now is 09:41 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"