Home |
Search |
Today's Posts |
#1
![]() |
|||
|
|||
![]()
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
![]() |
|||
|
|||
![]()
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
![]() |
|||
|
|||
![]()
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
![]() |
|||
|
|||
![]()
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
![]() |
|||
|
|||
![]()
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
![]() |
|||
|
|||
![]()
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 |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Conditional format based on data from another column | Excel Discussion (Misc queries) | |||
how to format only specific characters or numbers within each cellwithin a range of cells | Excel Discussion (Misc queries) | |||
Office2000: Conditional format behaves strangely | Excel Discussion (Misc queries) | |||
Conditional Format Titles | Excel Discussion (Misc queries) | |||
how to format numbers stored as text or vice versa to use vlookup | Excel Worksheet Functions |