View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Richard Buttrey Richard Buttrey is offline
external usenet poster
 
Posts: 296
Default checking input on a textbox in userform to be a %

On Fri, 19 Aug 2005 07:22:51 GMT, "Jean-Pierre D via OfficeKB.com"
wrote:

Hi,

i have a textbox in a userform that is linked tot cell A1 of the spreadsheet.
Cell A1 is defined as %.
When the user starts the userform the textbox will show 0,04 corresponding to
4% in cell A1.
However, if the userform is empty and the user types in 4 in the textbox,
cell A1 will show 400%.

how can i make sure that the input in a textbox will be seen as a percentage
so that if the input is 4, cell A1 will show 4% ?

thanks,
Jean-Pierre



You could try something like

If Range("a1") 1 Then Range("a1") = Range("a1") / 100

in the UserForm Terminate event, or some other suitable event.

Rgds

Rgds
__
Richard Buttrey
Grappenhall, Cheshire, UK
__________________________