nama sheet di taruh di B1
Dim sh As Worksheet
For Each sh In ThisWorkbook.Worksheets
[B1]=[B1]&","& sh.Name
Next sh
Nama Sheet di taruh di B1 ke bawah
For i = 1 To Sheets.Count
Cells(i, 2) = Sheets(i).Name
Next i
Nama Sheet di buat data validasi Vba excel
Private Sub CommandButton1_Click()
Dim wsArray As Variant
Dim sWsList As String
Dim x As Integer
wsArray = AllWorkSheets()
sWsList = Join(wsArray, ",")
With Sheets(1).Range("A1").Validation
.Delete
.Add Type:=xlValidateList, AlertStyle:=xlValidAlertStop, Operator:= _
xlBetween, Formula1:=sWsList
End With
End Sub
Public Function AllWorkSheets() As Variant
Dim wsArray() As Variant
Dim x As Integer
ReDim wsArray(Sheets.Count - 1)
For x = 0 To Sheets.Count - 1
wsArray(x) = Sheets(x + 1).Name
Next x
AllWorkSheets = wsArray
End Function
Nama Sheet di buat ComboBox Vba excel
Private Sub Worksheet_Activate()
ComboBox1.Clear
Dim sh As Worksheet
For Each sh In ThisWorkbook.Worksheets
Me.ComboBox1.AddItem sh.Name
Next sh
End Sub
Dim sh As Worksheet
For Each sh In ThisWorkbook.Worksheets
[B1]=[B1]&","& sh.Name
Next sh
Nama Sheet di taruh di B1 ke bawah
For i = 1 To Sheets.Count
Cells(i, 2) = Sheets(i).Name
Next i
Nama Sheet di buat data validasi Vba excel
Private Sub CommandButton1_Click()
Dim wsArray As Variant
Dim sWsList As String
Dim x As Integer
wsArray = AllWorkSheets()
sWsList = Join(wsArray, ",")
With Sheets(1).Range("A1").Validation
.Delete
.Add Type:=xlValidateList, AlertStyle:=xlValidAlertStop, Operator:= _
xlBetween, Formula1:=sWsList
End With
End Sub
Public Function AllWorkSheets() As Variant
Dim wsArray() As Variant
Dim x As Integer
ReDim wsArray(Sheets.Count - 1)
For x = 0 To Sheets.Count - 1
wsArray(x) = Sheets(x + 1).Name
Next x
AllWorkSheets = wsArray
End Function
Nama Sheet di buat ComboBox Vba excel
Private Sub Worksheet_Activate()
ComboBox1.Clear
Dim sh As Worksheet
For Each sh In ThisWorkbook.Worksheets
Me.ComboBox1.AddItem sh.Name
Next sh
End Sub