How to get Sheet list?

bhandari

Active Member
Joined
Oct 17, 2017
Messages
359
i am getting error,can i get some help here.how to collect the worksheet names in listbox by using macro?

i have around 20 sheets..i am planning to add few more sheets instead of finding all the sheets i want to find it through list box..

by using command buttons and listbox.
 

Excel Facts

Can a formula spear through sheets?
Use =SUM(January:December!E7) to sum E7 on all of the sheets from January through December
Hi, welcome to the board!

Did you know that if you right click the sheet navigation arrows immediately to the left of the sheet tabs then you get a list box with all the sheets in your workbook from which you can activate any.
 
Upvote 0
Try this:

Code:
Private Sub CommandButton1_Click()
Dim i As Long
ListBox1.Clear
    For i = 1 To Sheets.Count
        ListBox1.AddItem Sheets(i).Name
    Next
End Sub

Put this code in your Activex command button. It will put a list of all your sheet names in ListBox1
 
Last edited:
Upvote 0
Put this script in the ListBox:

Code:
Private Sub ListBox1_DblClick(ByVal Cancel As MSForms.ReturnBoolean)
Sheets(ListBox1.Value).Activate
End Sub



@My Aswer Is This hey iam getting sheet names in list box..

i was looking if i doubleclick that sheet name in listbox i must go to that page is it possible?
 
Upvote 0
i was looking if i doubleclick that sheet name in listbox i must go to that page is it possible?

Hi - just in case it got missed, this is built in functionality as described in post#2
 
Upvote 0
it is working fine i have pleanty of sheets so i am expecting scrolling button to my list box how to do that?
is it possible to add scroll button?
 
Upvote 0

Forum statistics

Threads
1,216,098
Messages
6,128,812
Members
449,468
Latest member
AGreen17

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top