create worksheet with specific name
MonthSelected = combobox1.Value
For Each sht In Sheets
If UCase(sht.Name) < "PLAN" Then
'test if there is a dash in sht names
If InStr(MonthSelected, "-") 0 Then
Mnth = Left(MonthSelected, _
InStr(MonthSelected, "-") - 1)
sht.Name = Mnth
MonthSelected = Mid(MonthSelected, _
InStr(MonthSelected, "-") + 1)
Else
sht.Name = MonthSelected
Exit For
End If
End If
Next sht
"Vladimir" wrote:
The workbook has already 4 worksheets: Plan and 3 reports.
In the first worksheet (plan) with a toolbox combobox the user will choose 1
of 4 options:
Jan-feb-march
apr-may-june
july-aug-sept
oct-nov-dec
when 1 of 4 options is choosen automatically other 3 worksheets shoud
receive respective names: say apr, may, june and in a cell of each worksheet
should appear April, May or June correspondingly.
|