cell auto deleting itself.

sbowen666

New Member
Joined
Sep 15, 2006
Messages
10
Please help.
I have a spreasheet with a command button opeing a userform, on the user form you select from a listbox and the value is entered into cell E3 and the userform closes.
However about 50% of the time the value entered in cell E3 disappears and also from then on if you type in cell E3 when you press enter the text just deletes itself.
The code i use is below:

Private Sub CommandButton1_Click()
UserForm1.Hide

End Sub







Private Sub UserForm_Initialize()
Dim Advisor As Variant
Dim Date1 As Variant


Advisor = Array("XXXX", "XXXX")

UserForm1.ListBox1.List = Advisor

'information contained date in list box
Date1 = Array("January 2006", "February 2006", "March 2006", "April 2006", "May 2006", _
"June 2006", "July 2006", "August 2006", "September 2006", "October 2006", _
"November 2006", "December 2006")
UserForm1.ListBox2.List = Date1

End Sub


I hope someone has heard of this problem. Not sure if there are property settings that would make this happen. (not that i have changed any i dont know)

Regards
 

Excel Facts

Excel Wisdom
Using a mouse in Excel is the work equivalent of wearing a lanyard when you first get to college
Hi, sbowen666,
Welcome to the Board !!!!!

Impossible for me to reproduce this error.
Do you have set the ControlSource of the listbox to E3 ?
Do you have code in the sheetmodule or thisworkbookmodule ?

It is not a big deal to rebuild a userform.
Try again (perhaps also in a new workbook).

kind regards,
Erik
 
Upvote 0
Hi, thank you for your response.
I appreciate it is difficult to reproduce I am glad that the post actually made sense i found it hard to descride.
Yes i have the control source set to E3,
An there is a button on the sheet which opens the userform, so the button is in the shhet module.
but the code is attached to the userform and held in the form folder, so it is on neither sheet nor thisworkbook module.

I will rebuild the model to get it working, however it would be nice to know if this has happened to anyone else and what causes it for my own curiosity.

Regards
 
Upvote 0
my question was not if the code itself is in the userform,
but if there is any code in the other modules

did you check that ?
you see: values in cells don't clear themselves without code, unless the workbook is really corrupt (I've seen values changing without any code)

if you don't get out, you may consider to send me the spreadsheet (only partially as long as it bugs)
erikvangeit @ fulladsl . be
(without spaces)

greetings,
Erik
 
Upvote 0
my apologies still learning VB.

In the sheet itself there is the following:

Private Sub CommandButton1_Click()
UserForm1.Show
End Sub

there is another sheet with the same code but for Userform2.
ANd there is nothing in the thisworkbook module.

Regards
 
Upvote 0
OK
rereading your first statement
the value entered in cell E3 disappears and also from then on if you type in cell E3 when you press enter the text just deletes itself
so when the userform is closed and you type in E3, the contents is cleared immediately without you doing anything else ?

if that's the case, I cannot see anything else than corrupt workbook

however it would be nice to know if this has happened to anyone else and what causes it for my own curiosity
to check it out feel free to email it (don't use emailbutton, but address in my previous post)
 
Upvote 0
Thank you for your suggestions.
I does appear to just be a glitch somewhere.

I think a rebuild will be the case and just have to accept the corruption.

Thanks for your time.

Regards
 
Upvote 0

Forum statistics

Threads
1,214,407
Messages
6,119,332
Members
448,888
Latest member
Arle8907

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top