LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 4,393
Default Need to add character before leading zero in a field

Sub addchar()
Set myrange = Range("D1:D10")
j = 1
For Each mycell In myrange
Cells(j, 4) = "x0" & mycell
j = j + 1
Next
End Sub

Change "D1:D10" to the Range you needed
Change j = 1 to j = N where N is the row of the first cell of your range
Change Cells(j, 4) to Cells(j, M) where M is the column number of your
range )
(A=1, B=2. etc)
Change "x0" to whatever character you want followed by 0
best wishes
--
Bernard V Liengme
Microsoft Excel MVP
www.stfx.ca/people/bliengme
remove caps from email

"Melin" wrote in message
...
I need an automated way to add a character before a leading zero in a
field.
I am importing information into excel from one software, manipulating the
information so I have only what I need and then exporting the information
into another software. We created a macro to keep the leading zero in
Excel
but the software we are importing the information into does not allow
leading
zeros. =( So we have to add a character to before the leading zero.

I am currently using Excel 2003. Any help would be appreciated.



 
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
How do I format a field in Excel to allow for leading zeros? debbie Excel Discussion (Misc queries) 3 April 16th 07 02:51 AM
Leading zeroes in ZIP field KateB Excel Discussion (Misc queries) 2 December 6th 06 12:44 AM
How do I force a leading zero character eg 07817 m800afc Excel Discussion (Misc queries) 3 March 22nd 06 07:27 PM
How can I prefill a text field with leading 0s? Sweetetc Excel Worksheet Functions 4 February 24th 06 07:04 PM
How to keep leading zero without changing field to text field? Deni Excel Discussion (Misc queries) 1 October 24th 05 10:48 PM


All times are GMT +1. The time now is 01:27 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"