#1   Report Post  
Posted to microsoft.public.excel.programming
C3 C3 is offline
external usenet poster
 
Posts: 13
Default Macro

How to make a macro who will check one entire column (etc. A) for numbers
with 4 digits and less and change it to a 5 digits numbers.

Example:

499 to 00499
1480 to 01480

and 5 digits number leave unchanged.


Thanks!


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,337
Default Macro

Just record this custom formatting. Modified to remove selections.
Sub Macro3()
'
' Macro3 Macro
' Macro recorded 6/1/2004 by Don Guillett
'

'
Range("C1:C200").NumberFormat = "00000"
End Sub

--
Don Guillett
SalesAid Software

"C3" wrote in message
...
How to make a macro who will check one entire column (etc. A) for numbers
with 4 digits and less and change it to a 5 digits numbers.

Example:

499 to 00499
1480 to 01480

and 5 digits number leave unchanged.


Thanks!




  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 22,906
Default Macro

C3

You don't need a macro for this, just select the column and
FormatCellsCustom. Enter 00000 and OK.

If you want a macro...........

Sub Five_Digits()
Columns("A:A").Select
Selection.NumberFormat = "00000"
End Sub

Gord Dibben Excel MVP


On Tue, 1 Jun 2004 15:06:40 +0200, "C3" wrote:

How to make a macro who will check one entire column (etc. A) for numbers
with 4 digits and less and change it to a 5 digits numbers.

Example:

499 to 00499
1480 to 01480

and 5 digits number leave unchanged.


Thanks!


Reply
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
Macro recorded... tabs & file names changed, macro hangs Steve Excel Worksheet Functions 3 October 30th 09 11:41 AM
Macro Help Needed - Excel 2007 - Print Macro with Auto Sort Gavin Excel Worksheet Functions 0 May 17th 07 01:20 PM
My excel macro recorder no longer shows up when recording macro jack Excel Discussion (Misc queries) 3 February 5th 07 08:22 PM
macro to delete entire rows when column A is blank ...a quick macro vikram Excel Programming 4 May 3rd 04 08:45 PM
Start Macro / Stop Macro / Restart Macro Pete[_13_] Excel Programming 2 November 21st 03 05:04 PM


All times are GMT +1. The time now is 07:15 PM.

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

About Us

"It's about Microsoft Excel"