Select Duplicate or Unique Rows; Select Blank Rows (all cells are empty); Super Find and Fuzzy Find in Many Workbooks; Random Select...
Exact Copy Multiple Cells without changing formula reference; Auto Create References to Multiple Sheets; Insert Bullets, Check Boxes and more...
Extract Text, Add Text, Remove by Position, Remove Space; Create and Print Paging Subtotals; Convert Between Cells Content and Comments...
Super Filter (save and apply filter schemes to other sheets); Advanced Sort by month/week/day, frequency and more; Special Filter by bold, italic...
Combine Workbooks and WorkSheets; Merge Tables based on key columns; Split Data into Multiple Sheets; Batch Convert xls, xlsx and PDF...
More than 300 powerful features. Supports Office/Excel
2007-2019 and 365. Supports all languages. Easy deploying in your enterprise or organization. Full features
30-day free trial. 60-day money back guarantee.
Thanks for you kind help. I'm a new Lerner of VBA and these article helps me a lot. I have used this code to show all worksheets in a userform combobox. It is perfect. I have a doubt. Can I show those sheet name alphabetically on Userform_Initialize? Though my worksheets are not arranged alphabetically.
Please guide me how to proceed further with my requirement.
Sorry for replying so late. The following VBA code can help you solve the problem.
Private Sub UserForm_Initialize()
Dim xWSs As Worksheets
Dim xWS As Worksheet
Dim xName As String
Dim xI As Integer
Dim xRg As Range
On Error Resume Next
xName = "StoreWorkSheetsName"
Application.DisplayAlerts = False
If Not Evaluate("=ISREF('" & xName & "'!A1)") Then Sheets.Add(after:=Worksheets(Worksheets.count)).Name = xName & ""
Else Sheets(xName & "").Move after:=Worksheets(Worksheets.count)
Set xWS = Sheets(xName & "")
For xI = 1 To Sheets.count - 1 xWS.Range("A" & xI).Value2 = Sheets(xI).Name
xI = xI - 1
Set xRg = xWS.Range("A1:A" & xI) ActiveWorkbook.Worksheets(xName).Sort.SortFields.Clear
ActiveWorkbook.Worksheets(xName).Sort.SortFields.Add Key:= _ Range("A1:A" & xI), SortOn:=xlSortOnValues, Order:=xlAscending, DataOption:= _
With ActiveWorkbook.Worksheets(xName).Sort .SetRange Range("A1:A" & xI)
.Header = xlGuess .MatchCase = False
.Orientation = xlTopToBottom .SortMethod = xlPinYin
.Apply End With
For i = 1 To xRg.count Me.ComboBox1.AddItem xRg.Item(i).Value
Me.ComboBox1.Value = ActiveSheet.Name
Application.DisplayAlerts = True