I am new to vba. i have big workbook with 200 sheets - need vba code to populate listbox ( or combobox) with sheetnames. Then i need to go to sheet if i click on sheetname. new sheets are added, old ones deleted. Please help.
I am new to vba. i have big workbook with 200 sheets - need vba code to populate listbox ( or combobox) with sheetnames. Then i need to go to sheet if i click on sheetname. new sheets are added, old ones deleted. Please help.
Hi
- Press Alt+F11 Go to Insert and choose Userform
- Insert Listbox cotrol to the userform
- Double click o the userform (VBE will open)
- Paste this code there
Please Login or Register to view this content.
- Close VBE
- Insert a button and double click it
- Paste this code
Please Login or Register to view this content.
- Close VBE and Press DesignView Button so that button become clickable
Ready. Dummy is attached..
HTH
Люди, питающие благие намерения, как раз и становятся чудовищами.
Regards, ?Born in USSR?
Vusal M Dadashev
Baku, Azerbaijan
This is a built-In facility in Excel.
go to scrollbuttons on the pagetab, (left lower corner of the window)
rightclick your mouse
choose the desired sheet.
Hey, you can use multiple ways do close it, either you can just create a button on the UserForm underneath for example the listbox or you can tell it programmatically that once you clicked on one of the selection option in the listbox to close down the UserForm.
This will close down the Userform after selecting a tab:
If you use the button approach just set up a button and add the code Unload Me on the actioncode.Please Login or Register to view this content.
Maybe this is even more what you need (instead of using Excel's built-in facilities)
It's implemented in the attachment.
1. make a dropdownlist in the MenuBar (scrutinize the name of the personal workbook !)
2. Put this code in the workbook you want its sheets being displayed in the dropdownlist in the MenubarPlease Login or Register to view this content.
3. put this macro in your personal.xlsPlease Login or Register to view this content.
Please Login or Register to view this content.
Last edited by snb; 08-17-2010 at 05:08 AM.
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks