K
Kevlar
I have this code to set a cells format whenever data is entered from a
user form.
Private Sub TextBox5_Enter()
Range("R$25").Value = Round((Range("$m$25").Value +
(Range("$n$25").Value)) * (1 + Range("$q$25").Value))
TextBox5.Value = Round((Range("$m$25").Value +
(Range("$n$25").Value)) * (1 + Range("$q$25").Value))
Range("R$25").NumberFormat = "_($* #,##0.00_);_($* (#,##0.00);_($*
""-""??_);_(@_)"
End Sub
It works the first time I use it. The second and each subsequent time I
get a run time error '1004' Unable to set the number format property of
the range class.
Anyone got any ideas?
By the way I got the number format by using the record macro trick.
user form.
Private Sub TextBox5_Enter()
Range("R$25").Value = Round((Range("$m$25").Value +
(Range("$n$25").Value)) * (1 + Range("$q$25").Value))
TextBox5.Value = Round((Range("$m$25").Value +
(Range("$n$25").Value)) * (1 + Range("$q$25").Value))
Range("R$25").NumberFormat = "_($* #,##0.00_);_($* (#,##0.00);_($*
""-""??_);_(@_)"
End Sub
It works the first time I use it. The second and each subsequent time I
get a run time error '1004' Unable to set the number format property of
the range class.
Anyone got any ideas?
By the way I got the number format by using the record macro trick.