Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming,microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 12
Default left padding + blank

Hello,

Is it possible to left pad a cell, but only if it's not blank ?

eg,
600 = 00600
50000 = 50000
[blank] = [blank]

(I've just succeeded for non-blank cells)

Thanks in advance.
  #2   Report Post  
Posted to microsoft.public.excel.programming,microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 2
Default left padding + blank

Hi Alex,

How about selecting the range and setting a custom format of 00000?

Regards,

Peter Beach

"Alex" <. wrote in message
...
Hello,

Is it possible to left pad a cell, but only if it's not blank ?

eg,
600 = 00600
50000 = 50000
[blank] = [blank]

(I've just succeeded for non-blank cells)

Thanks in advance.



  #3   Report Post  
Posted to microsoft.public.excel.programming,microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 12
Default left padding + blank

Peter Beach wrote:
Hi Alex,

How about selecting the range and setting a custom format of 00000?

Regards,


Thanks for your answer...
But I don't think I can do that, as the formatted cell is the result of
another cell (a column of cells) in another sheet...
  #4   Report Post  
Posted to microsoft.public.excel.programming,microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 18
Default left padding + blank

If you are saying that the cell contains a formula which brings a value
from somewhere else, then it doesn't matter - the format of this cell
can be set independently of the other cell(s). Try it, and see if it
does what you want.

If there is a formula in the cell you are trying to format, then the
formula could be modified to give you the effect you are wanting -
please post it here.

Pete

  #5   Report Post  
Posted to microsoft.public.excel.programming,microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 12
Default left padding + blank

Pete wrote:

If you are saying that the cell contains a formula which brings a value
from somewhere else, then it doesn't matter - the format of this cell
can be set independently of the other cell(s). Try it, and see if it
does what you want.

If there is a formula in the cell you are trying to format, then the
formula could be modified to give you the effect you are wanting -
please post it here.


It's just something like that : =TEXT(A1;"00###")
For blank cells, I get "00", but I would want the cells to remain blank...


  #6   Report Post  
Posted to microsoft.public.excel.programming,microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 3,268
Default left padding + blank

=IF(A1="";"";TEXT(A1;"00###"))


--

Regards,

Peo Sjoblom

"Alex" <. wrote in message
...
Pete wrote:

If you are saying that the cell contains a formula which brings a value
from somewhere else, then it doesn't matter - the format of this cell
can be set independently of the other cell(s). Try it, and see if it
does what you want.

If there is a formula in the cell you are trying to format, then the
formula could be modified to give you the effect you are wanting -
please post it here.


It's just something like that : =TEXT(A1;"00###")
For blank cells, I get "00", but I would want the cells to remain blank...



  #7   Report Post  
Posted to microsoft.public.excel.programming,microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 12
Default left padding + blank

Peo Sjoblom wrote:
=IF(A1="";"";TEXT(A1;"00###"))


Ah yes, thanks... so simple, sorry.
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
wrap text inserts a padding blank line Walter Briscoe New Users to Excel 1 September 6th 09 03:15 PM
Autofill Down When Text to Left is Not Blank ryguy7272 Excel Worksheet Functions 2 September 20th 07 06:18 AM
Validating cells left blank chris100[_42_] Excel Programming 4 December 4th 05 05:39 PM
counting from left to right and stopping when blank harpscardiff Excel Discussion (Misc queries) 6 August 19th 05 07:34 PM


All times are GMT +1. The time now is 01:19 AM.

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"