prefix in text box

  • Thread starter Thread starter pswanie
  • Start date Start date
P

pswanie

would it be posible to default the amount enterd in a text box with the
prefix "R" and "." to seperate sents? we use amounts like R1125.80

and show amounts in lable as that to?

i got this:



Label24.Caption = Range("l65536").End(xlUp).Value
 
would it be posible to default the amount enterd in a text box with the
prefix "R" and "." to seperate sents? we use amounts like R1125.80

and show amounts in lable as that to?

i got this:

Label24.Caption = Range("l65536").End(xlUp).Value

No need for code. You can define a custom format for the cells with
those values. Select the cells then Menu -> Format -> Cells ->
Custom. Then select the "0.00" format and insert the "R" to the left
of the number format. The R will then be prefixed to values that
people add into the worksheet.

If you want to use code, macro capture of the above sequence gives
you:

Range("C7:C10").Select
Selection.NumberFormat = "R0.00"

You can include the NumberFormat line in your subs to give you what
you want.

SteveM
 
this is what i use now. thinking of using a command button to rather "update"

or what better way is there?

that line does not show label24 in that format

Private Sub MultiPage1_change()
Label13.Caption = Range("f65536").End(xlUp).Value
Label15.Caption = Range("n65536").End(xlUp).Value
Label19.Caption = Range("i65536").End(xlUp).Value
Label24.Caption = Range("l65536").End(xlUp).Value
Selection.NumberFormat = "R0.00"
Label32.Caption = Range("m65536").End(xlUp).Value


End Sub
 
this is what i use now. thinking of using a command button to rather "update"

or what better way is there?

that line does not show label24 in that format

Private Sub MultiPage1_change()
Label13.Caption = Range("f65536").End(xlUp).Value
Label15.Caption = Range("n65536").End(xlUp).Value
Label19.Caption = Range("i65536").End(xlUp).Value
Label24.Caption = Range("l65536").End(xlUp).Value
Selection.NumberFormat = "R0.00"
Label32.Caption = Range("m65536").End(xlUp).Value

End Sub










- Vis tekst i anførselstegn -

Label24.Caption = Format(Range("l65536").End(xlUp).Value, "R0.00")

// Per
 
Back
Top