Vba Code For Dropbox

leoruphen

New member
Joined
Feb 2, 2014
Messages
2
Reaction score
0
Points
0
Hello all,
I need a help to display all my sheets in my main sheets dropbox.
i also have a button (update database). so, when i add new sheet i click the update database button so that the new sheet can be listed out on the dropbox in the main page.

Thanks and regards,
Leo

i have attached the picture of my dropbox. please let me know if you guys need any additional information.
 

Attachments

  • Capture.JPG
    Capture.JPG
    19.9 KB · Views: 75
Is that a combobox and 3 command buttons on a userform with a separate command button on a worksheet?

You would be far more likely to receive assistance if you upload a sample workbook of what you are working with rather a picture.
 
Hi NoS,
Yes its is a combobox, i have provide the workbook example for your assistance.
thank you.
 

Attachments

  • test 1.xlsm
    50.7 KB · Views: 120
Hello leoruphen

To answer your question of populating the combobox, put this code into the "Main" sheet's module and see if it does what you want when sheets are added or deleted.
You will need to go into the properties for the combobox and remove "fixed" from value so it will be blank.

Code:
Private Sub Worksheet_Activate()
    Dim sht As Worksheet
    
With ComboBox1
   .Clear
    For Each sht In ThisWorkbook.Worksheets
        If sht.Name <> "Main" Then
            If sht.Name <> "fixed" Then
                .AddItem sht.Name
            End If
        End If
    Next sht
End With

End Sub
 
Last edited:
Back
Top