Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 67
Default Drop down list disapear

I use drop down list in my data validation. The problem is, sometimes,
after I run the VBA code, the drop down list is missing. Any idea why
this could happen ? I have to exit from excel application and open it
again to get drop down list work as normal.
Thanks

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,092
Default Drop down list disapear

Perhaps if you provide the code we can figure out what is happening.

Mike F
"broogle" wrote in message
oups.com...
I use drop down list in my data validation. The problem is, sometimes,
after I run the VBA code, the drop down list is missing. Any idea why
this could happen ? I have to exit from excel application and open it
again to get drop down list work as normal.
Thanks



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 67
Default Drop down list disapear

Hi Mike,

This is the event change code that I'm using. It didn't happen all the
time, just occasionally.
This code just prevent the user to delete certain cells (but these
cells are not the drop down list cells). Thanks

'Checking C7 - C12
On Error GoTo errHandler:
Application.AutoPercentEntry = True
Dim myData As Range
Set myData = Range("c7, c8, c9, c10, c11, c12, c18, d18")

If Target.Cells < "" Then GoTo Table_A
If Intersect(myData, Target) Is Nothing Then Exit Sub

If Target.value = "" Then
MsgBox "Please fix: " & Target.Address & vbLf & _
"It can not be blank !"
With Application
.EnableEvents = False
.Undo
End With
End If

Table_A:

If Target.value <= 0 Then
Exit Sub
End If

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,092
Default Drop down list disapear

This seems to be part of a procedure but I think the problem lies with:
With Application
.EnableEvents = False
.Undo
End With

I don't see where EnableEvents becomes True again but mostly the .Undo will
occur every time an empty target cell is activated including anything that
was done to a non-target cell. Maybe it just Undid your list. If this is
meant to Undo a delete, then you need to trap for the fact that a target
cell was deleted and then do the .Undo, not just because the cell was empty.
Help with that code needs to come from someone better than me.

Mike F
"broogle" wrote in message
oups.com...
Hi Mike,

This is the event change code that I'm using. It didn't happen all the
time, just occasionally.
This code just prevent the user to delete certain cells (but these
cells are not the drop down list cells). Thanks

'Checking C7 - C12
On Error GoTo errHandler:
Application.AutoPercentEntry = True
Dim myData As Range
Set myData = Range("c7, c8, c9, c10, c11, c12, c18, d18")

If Target.Cells < "" Then GoTo Table_A
If Intersect(myData, Target) Is Nothing Then Exit Sub

If Target.value = "" Then
MsgBox "Please fix: " & Target.Address & vbLf & _
"It can not be blank !"
With Application
.EnableEvents = False
.Undo
End With
End If

Table_A:

If Target.value <= 0 Then
Exit Sub
End If



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
Editing options disapear when document is changed to compatibility Me Excel Discussion (Misc queries) 4 April 19th 10 03:14 PM
Drop down list - how doo I make selection disapear? Tore Excel Discussion (Misc queries) 4 January 26th 09 01:38 PM
Drop down list dependant on previous drop down list Tenacioushail Excel Discussion (Misc queries) 1 July 1st 08 11:35 AM
making the chart disapear when there is no text Erin Leva[_2_] Charts and Charting in Excel 1 May 31st 08 12:45 PM
multiple select from the drop down list in excel. list in one sheet and drop down in sriramus Excel Discussion (Misc queries) 5 October 27th 05 06:55 PM


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

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

About Us

"It's about Microsoft Excel"