Do... Loop Until Loops with Worksheets : Worksheets « Excel « VBA / Excel / Access / Word






Do... Loop Until Loops with Worksheets

 
 Sub Create_Worksheets()
     Dim strNewSheet As String
     Do
         strNewSheet = "asdf"
         If strNewSheet <> "" Then
             ActiveWorkbook.Worksheets.Add
             ActiveSheet.Name = strNewSheet
         End If
     Loop Until strNewSheet = ""
 End Sub

 








Related examples in the same category

1.Looping Through Worksheets in a Workbook
2.move the second worksheet to end of workbook
3.performs a simple bubble sort to sort the worksheets in the workbook
4.For...Next Loop with Worksheet
5.The Sheets Collection
6.Grouping Worksheets
7.Dynamic Arrays for worksheet name
8.Use for loop to loop through all worksheets
9.Sort all worksheets