Macro error

  • Thread starter Thread starter orquidea
  • Start date Start date
O

orquidea

Hi All:

I want to get the result in saskour20per as a percentage. I wrote the below
procedure which is generating the error "invalid qualifier".

Saskour20per.Value = (saskour20 / sask20)
Saskour20per.NumberFormat = "0.00%"

Could anyone help me to debug this macro?

Thanks in advance
Orquidea
 
Your code will work if Saskour20per is a Range variable that has been
assinged a value. The values of the numerator and denominator must also be
established as well. Something like:

Dim Saskour20per as Range
Set Saskour20per=Range("A1")
Saskour20per.Value = (saskour20 / sask20)
Saskour20per.NumberFormat = "0.00%"
 
thanks for your answer.

Gary''s Student said:
Your code will work if Saskour20per is a Range variable that has been
assinged a value. The values of the numerator and denominator must also be
established as well. Something like:

Dim Saskour20per as Range
Set Saskour20per=Range("A1")
Saskour20per.Value = (saskour20 / sask20)
Saskour20per.NumberFormat = "0.00%"
 
Back
Top