View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Bernie Deitrick Bernie Deitrick is offline
external usenet poster
 
Posts: 5,441
Default Format change when user select a Factor on drop down box

liem,

Try this.

Copy the code below, right-click the cheet tab, select "View Code" and paste the code in the window
that appears.

The code is written for your dropdown being in Cell A3. Change that to the correct cell, with the $s
as shown.

HTH,
Bernie
MS Excel MVP

Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Address < "$A$3" Then Exit Sub
If InStr(Target.Value, "$") 0 Then
Range("A4").NumberFormat = "$0.00"
Else
Range("A4").NumberFormat = "0.00%"
End If
End Sub



"liem" wrote in message
...
I have a drop down box with many Factors. when the user select one factor
below I like the data to show up as correct format on the out put .
How can i do it ?
Drop down box 1- Merchandise $
2- Gas $
3- Merchandise margin %
4- Gas margin %

on cell A4 I format as Currency.




--
thanks