Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default vba problem dialogue box and cell in sheet

Hi,

I'am using a userform with a textbox to have the user input a value.
The textbox has a controlsource in the sheet (cell d6)which is formatted as
a percentage.

Now: When the user puts in "3", cell D6 is filled with 300% ! This is not
what i want.

So i made a VBA code in the textbox_before_update() section which checks if
the number put in 1 and then devides it by 100.
This works fine but :

Cell D6 in the worksheet is not updated !
I tried to put the same check code in the textbox_change()section, but that
did not help.

Any ideas?
Thanks,
Jean-Pierre


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,718
Default vba problem dialogue box and cell in sheet

I would suggest that you get rid of the control source and have the macro
put the right result in the worksheet.

--
Jim
"Jean-Pierre" wrote in message
...
Hi,

I'am using a userform with a textbox to have the user input a value.
The textbox has a controlsource in the sheet (cell d6)which is formatted
as
a percentage.

Now: When the user puts in "3", cell D6 is filled with 300% ! This is not
what i want.

So i made a VBA code in the textbox_before_update() section which checks
if
the number put in 1 and then devides it by 100.
This works fine but :

Cell D6 in the worksheet is not updated !
I tried to put the same check code in the textbox_change()section, but
that
did not help.

Any ideas?
Thanks,
Jean-Pierre




  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 770
Default vba problem dialogue box and cell in sheet

Jean-Pierre,

Instead of using the ControlSource I'd use two macros like these in the
userform:

Private Sub UserForm_Initialize()
Me.TextBox1.Text = Format(Worksheets("Sheet1").Range("D6"), "0.00%")
End Sub

Private Sub TextBox1_AfterUpdate()
Worksheets("Sheet1").Range("D6") = Me.TextBox1.Text
End Sub

hth,

Doug

"Jean-Pierre" wrote in message
...
Hi,

I'am using a userform with a textbox to have the user input a value.
The textbox has a controlsource in the sheet (cell d6)which is formatted
as
a percentage.

Now: When the user puts in "3", cell D6 is filled with 300% ! This is not
what i want.

So i made a VBA code in the textbox_before_update() section which checks
if
the number put in 1 and then devides it by 100.
This works fine but :

Cell D6 in the worksheet is not updated !
I tried to put the same check code in the textbox_change()section, but
that
did not help.

Any ideas?
Thanks,
Jean-Pierre




Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Why can't I see the Protection tab on cell format dialogue box? wmcgrath Excel Worksheet Functions 0 July 11th 06 08:01 PM
Display in cell not dialogue box sparx Excel Discussion (Misc queries) 4 March 20th 06 10:57 PM
open cell formationg dialogue from macro dayanand108 Excel Programming 1 July 21st 05 08:44 PM
dialogue box problem Lynda Excel Programming 2 February 5th 05 07:10 PM
Problem pasting a row from a hidden sheet to the first free row on another visible sheet Didier Poskin Excel Programming 2 January 10th 04 01:18 AM


All times are GMT +1. The time now is 11:38 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"