Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
PiPPo
 
Posts: n/a
Default Conditional format numbers

Hi,
This is my problem. I would like to format a number in B1 on the basis
of a certain condition in A1.
I read in another post that I need a macro to conditional format
numbers. Is that correct? Where can I find such macro? If this is not
the case, can anyone help me with my problem?

Thank you,

Pippo

  #2   Report Post  
Anne Troy
 
Posts: n/a
Default Conditional format numbers

You don't necessarily need a macro, unless you want more than 3 conditional
formats. Likely, you just need a formula CF:
http://www.officearticles.com/excel/...ft_ excel.htm

If you need the macro after all:
http://vbaexpress.com/kb/getarticle.php?kb_id=90
************
Anne Troy
www.OfficeArticles.com

"PiPPo" wrote in message
oups.com...
Hi,
This is my problem. I would like to format a number in B1 on the basis
of a certain condition in A1.
I read in another post that I need a macro to conditional format
numbers. Is that correct? Where can I find such macro? If this is not
the case, can anyone help me with my problem?

Thank you,

Pippo



  #3   Report Post  
PiPPo
 
Posts: n/a
Default Conditional format numbers

Well,

What I need is to format the value in a cell on the basis of a
condition in another cell. The number I want to format has to assume
one of the three following formats: X%, X or Xd, where X is a not
bounded number of figures . In other words, the value may be a
percentage, an integer number or a special format Xd.

Dos anyone have an idea?

Thank you very much

  #4   Report Post  
Biff
 
Posts: n/a
Default Conditional format numbers

Perhaps if you gave us some specific examples.

It would also help if you told us what the condition is!!!!!!!!!!!

Biff

"PiPPo" wrote in message
oups.com...
Well,

What I need is to format the value in a cell on the basis of a
condition in another cell. The number I want to format has to assume
one of the three following formats: X%, X or Xd, where X is a not
bounded number of figures . In other words, the value may be a
percentage, an integer number or a special format Xd.

Dos anyone have an idea?

Thank you very much



  #5   Report Post  
PiPPo
 
Posts: n/a
Default Conditional format numbers

Ok, I apologize for not being clear.

In A1 I want to put one of the following three strings of text:
"Inventory", "Inventory - % of COGS", "Inventory - DIO". Cell B1 has to
be formatted as an integer number if "Inventory" is chosen, a
percentage number if "Inventory - % of COGS" is chosen or as a special
format Xd (where d stands for days) when the third condition is
selected.

Thank you again.



  #6   Report Post  
Rowan Drummond
 
Posts: n/a
Default Conditional format numbers

You cannot use Conditional formatting to change number formats so you
would need to use a worksheet change event something like this:

Private Sub Worksheet_Change(ByVal Target As Range)
On Error GoTo ErrorHandler
Application.EnableEvents = False
If Target.count = 1 And Target.Address = "$A$1" Then
Select Case Target.Value
Case "Inventory"
Range("B1").NumberFormat = "#,##0"
Case "Inventory - % of COGS"
Range("B1").NumberFormat = "0.00%"
Case "Inventory - DIO"
Range("B1").NumberFormat = "Xd"
End Select
End If
ErrorHandler:
Application.EnableEvents = True
End Sub

This is worksheet event code. Right click the sheet tab, select View
Code and Paste the code in there.

Hope this helps
Rowan

PiPPo wrote:
Ok, I apologize for not being clear.

In A1 I want to put one of the following three strings of text:
"Inventory", "Inventory - % of COGS", "Inventory - DIO". Cell B1 has to
be formatted as an integer number if "Inventory" is chosen, a
percentage number if "Inventory - % of COGS" is chosen or as a special
format Xd (where d stands for days) when the third condition is
selected.

Thank you again.

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
Conditional format based on data from another column Ellie Excel Discussion (Misc queries) 3 May 14th 08 05:23 PM
how to format only specific characters or numbers within each cellwithin a range of cells Colleen Excel Discussion (Misc queries) 4 September 12th 05 10:04 PM
Office2000: Conditional format behaves strangely Arvi Laanemets Excel Discussion (Misc queries) 1 April 7th 05 08:47 AM
Conditional Format Titles Jenn Excel Discussion (Misc queries) 1 February 22nd 05 10:41 PM
how to format numbers stored as text or vice versa to use vlookup teneagle Excel Worksheet Functions 1 February 3rd 05 11:41 PM


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