Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.misc
|
|||
|
|||
Formating percentage in macro
Hi
In the below subprocedure I want to format Saskour20per with %. This result Saskour20per will be placed in different cells depending of some if conditions, therefore I can't set a Range("A1") for example. Saskour20per = (saskour20 / sask20) How could I do that. Thanks in advance. Orquidea |
#2
Posted to microsoft.public.excel.misc
|
|||
|
|||
Formating percentage in macro
hi
you didn't say how many cells or which cells so....... format each cell you put it in...... Range("A1").Value = saskour20per Range("A1").NumberFormat = "0.00%" Range("B2").Value = saskour20per Range("B2").NumberFormat = "0.00%" Range("C3").Value = saskour20per Range("C3").NumberFormat = "0.00%" each cell you put it in.... if you are working with variables just substitute the range address with the variable. REgards FSt1 "orquidea" wrote: Hi In the below subprocedure I want to format Saskour20per with %. This result Saskour20per will be placed in different cells depending of some if conditions, therefore I can't set a Range("A1") for example. Saskour20per = (saskour20 / sask20) How could I do that. Thanks in advance. Orquidea |
#3
Posted to microsoft.public.excel.misc
|
|||
|
|||
Formating percentage in macro
Hi
Thanks for your answer. As I am working with variables I susbstituted the range address with the variable but I get the error message "invalid qualifier" and it highlights the underlined statement. If sask20 < 0 Then Saskour20per.Value = (saskour20 / sask20) -------------------------- Saskour20per.NumberFormat = "0.00%" Could you please tell me where I am making an error? Thanks in advance Orquidea "FSt1" wrote: hi you didn't say how many cells or which cells so....... format each cell you put it in...... Range("A1").Value = saskour20per Range("A1").NumberFormat = "0.00%" Range("B2").Value = saskour20per Range("B2").NumberFormat = "0.00%" Range("C3").Value = saskour20per Range("C3").NumberFormat = "0.00%" each cell you put it in.... if you are working with variables just substitute the range address with the variable. REgards FSt1 "orquidea" wrote: Hi In the below subprocedure I want to format Saskour20per with %. This result Saskour20per will be placed in different cells depending of some if conditions, therefore I can't set a Range("A1") for example. Saskour20per = (saskour20 / sask20) How could I do that. Thanks in advance. Orquidea |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Macro fails to produce Category Name and Percentage values - Pie C | Charts and Charting in Excel | |||
Conditional formating or Macro code | Excel Discussion (Misc queries) | |||
How to program a macro to hide rows with conditionnal formating | Excel Discussion (Misc queries) | |||
Inserting and Formating Variables in a Header using a macro | Excel Discussion (Misc queries) | |||
formating macro | Excel Discussion (Misc queries) |