View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Tom Ogilvy Tom Ogilvy is offline
external usenet poster
 
Posts: 27,285
Default Formating to Percents in a UserForm

Private Sub UserForm_Initialize()
Me.TextBox1.Value = Format(Worksheets(1).Range("AA1").Value,"0%")
Me.TextBox2.Value = Format(Worksheets(1).Range("AA2").Value,"0%")
Me.TextBox3.Value = Format(Worksheets(1).Range("AA3").Value,"0%")
Me.TextBox4.Value = Format(Worksheets(1).Range("AA4").Value,"0%")
End Sub

--
Regards,
Tom Ogilvy


Todd Huttenstine wrote in message
...
I have the following code. In cell AA1:AA4 there are
numbers. For instance the number in cell AA1 is .35. The
code pulls the value from the specified cells and displays
it in the cooresponding textbox. When the userform is
loaded, the text boxes display the numbers in .XX
format..... for example Textbox1 displays .35. I would
like for the textboxes to show the numbers in percent
format. For example I would like textbox1 to show 35%
instead of .35. What is the code for this?

Private Sub UserForm_Initialize()
Me.TextBox1.Value = Worksheets(1).Range("AA1").Value
Me.TextBox2.Value = Worksheets(1).Range("AA2").Value
Me.TextBox3.Value = Worksheets(1).Range("AA3").Value
Me.TextBox4.Value = Worksheets(1).Range("AA4").Value
End Sub





Thanks in advance to all who reply.

Todd Huttenstine