Drop down arrow disappear

  • Thread starter Thread starter broogle
  • Start date Start date
B

broogle

I have a drop down list in my data validation, but everytime I run my
code, the drop down button will disappear, to get it back I have to
close my excel (not just the current worksheet) and re-run it again.
Which code is taking control of this button ? Thanks
 
Hi,

Without your code, hard to say. Add a copy to your posting.
Regards

Jean-Yves
 
Ok, here is my code. Thanks.

Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As
Boolean)

On Error GoTo errHandler:

Range("c9").Activate

filesavename = Application.GetSaveAsFilename(Sheet1.Range("C10") &
Sheet1.Range("C7"), _
fileFilter:="Microsoft Excel Workbook (*.xls), *.xls")

If filesavename <> False Then

Application.DisplayAlerts = False
Dim resp As Long
resp = vbYes
If Dir(filesavename) <> "" Then
resp = MsgBox(Prompt:=filesavename & " already exist, overwrite?",
Buttons:=vbYesNo)
End If
If resp = vbYes Then

Application.ScreenUpdating = False
Application.EnableEvents = False
ActiveWorkbook.SaveAs filesavename

Dim myXLS, mypath
Dim myCSV As String
myXLS = ActiveWorkbook.Name
myCSV = Replace(myXLS, ".xls", ".csv")
mypath = ActiveWorkbook.Path
Sheets("Basic").Select

ActiveSheet.Copy
ActiveWorkbook.SaveAs filename:= _
mypath & "\" & myCSV _
, FileFormat:=xlCSV, Password:="", WriteResPassword:="", _
ReadOnlyRecommended:=False, CreateBackup:=False
ActiveWorkbook.Close

MsgBox (myCSV & " have been created and saved in the same directory
with " & myXLS)

Sheets("Advance").Select

Application.EnableEvents = True

Application.DisplayAlerts = True
End If
Else
Cancel = True
End If

Cancel = True

errHandler:
Application.EnableEvents = True
Application.ScreenUpdating = True
Application.DisplayAlerts = True
End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top