ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Userform Canellation. (https://www.excelbanter.com/excel-programming/380071-userform-canellation.html)

Corey

Userform Canellation.
 
I am creating a userform with hlp from some other forum users.
I have just noticed that when a value is placed intop a textbox, or
combobox, the sheet that those values WILL be placed in from the userform
are being input in the background as typing of the values is carried out.

This is nopt a problem.(But thought application.screenupdating = false)
removes this, but If i need to cancel the userform via the Cancel
button(unload me),
I then have to nagivate to the sheet and manually clear the data the
userform was putting in the cells.

1. How do i prevent the data being placed into the sheet UNTIL the OK button
is clicked,
or

2. How do i have the data entered into the userform cleard from the sheet IF
i click cancel ?


Corey....



Abdul[_2_]

Userform Canellation.
 
Hi,

Please give us your code so we can clearly understand it.
if you are putting your code to transfer the data under the textbox or
combobox change event it will not write it your cell unless you press
your OK button.

If I have textbox1 and commandbuuton1 in a user form then
The value of textbox1 will be entered in sheet1 range A1 only when i
press the commandbutton1 using the following code

Private Sub CommandButton1_Click()
Sheets("Sheet1").Range("A1") = TextBox1.Value
End Sub


Thanks


Corey wrote:
I am creating a userform with hlp from some other forum users.
I have just noticed that when a value is placed intop a textbox, or
combobox, the sheet that those values WILL be placed in from the userform
are being input in the background as typing of the values is carried out.

This is nopt a problem.(But thought application.screenupdating = false)
removes this, but If i need to cancel the userform via the Cancel
button(unload me),
I then have to nagivate to the sheet and manually clear the data the
userform was putting in the cells.

1. How do i prevent the data being placed into the sheet UNTIL the OK button
is clicked,
or

2. How do i have the data entered into the userform cleard from the sheet IF
i click cancel ?


Corey....



Bob Phillips

Userform Canellation.
 
Change your code to write to the sheet on an explicit action, such as
clicking a commanbutton, not as it is entered.

--
---
HTH

Bob

(change the xxxx to gmail if mailing direct)


"Corey" wrote in message
...
I am creating a userform with hlp from some other forum users.
I have just noticed that when a value is placed intop a textbox, or
combobox, the sheet that those values WILL be placed in from the userform
are being input in the background as typing of the values is carried out.

This is nopt a problem.(But thought application.screenupdating = false)
removes this, but If i need to cancel the userform via the Cancel
button(unload me),
I then have to nagivate to the sheet and manually clear the data the
userform was putting in the cells.

1. How do i prevent the data being placed into the sheet UNTIL the OK
button is clicked,
or

2. How do i have the data entered into the userform cleard from the sheet
IF i click cancel ?


Corey....





All times are GMT +1. The time now is 12:09 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com