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
 

Some videos you may like

Excel Facts

Format cells as currency
Select range and press Ctrl+Shift+4 to format cells as currency. (Shift 4 is the $ sign).

erik.van.geit

MrExcel MVP
Joined
Feb 1, 2003
Messages
17,832
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
 

sbowen666

New Member
Joined
Sep 15, 2006
Messages
10
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
 

erik.van.geit

MrExcel MVP
Joined
Feb 1, 2003
Messages
17,832
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
 

sbowen666

New Member
Joined
Sep 15, 2006
Messages
10

ADVERTISEMENT

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
 

erik.van.geit

MrExcel MVP
Joined
Feb 1, 2003
Messages
17,832
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)
 

sbowen666

New Member
Joined
Sep 15, 2006
Messages
10
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
 

Watch MrExcel Video

Forum statistics

Threads
1,109,445
Messages
5,528,801
Members
409,835
Latest member
Mafu1267

This Week's Hot Topics

  • Change military grades into rank
    Afternoon all Need help with formula that will change military rank (i.e. 1, 2, 3 into Amn, A1C, SrA). Running IF formula that does not work...
  • VBA COUNTIF SOLUTION
    Hi The following are the errors spread across the several columns from E to Q ie. 13 columns across several sheets with more than 500 rows per...
  • INSERT ROW WITH SPECIFIS TEXT IN A COLUMN
    Hi All! How can identify that that the row to be inserted has to be inserted before 1st row with specific text in column F. If I record the...
  • Auto-Create a monthly Sign in sheet for preschool students
    The image below is what each page looks like. Above is space for the "Child Name" "Month" "Class" School days are obviously Monday-Friday but...
  • VBA vlookup multiple results
    Hi folks, Hopefully someone out there can help. I have a list to vlookup which works (ish). the lookup only picks up the first instance of the...
  • Extract values for earliest/latest times
    I am trying to put together a formula to get the earliest start time, the latest end time from column A for each person in Column B-F without the...
Top