Discover new time-saving features in one game-changing release, ScreenConnect 6.0, based on partner feedback. New features include a redesigned UI, app configurations and chat acknowledgement to improve customer engagement!
Private Sub cmdAddSheets_Click() 'dim variables Dim x As Integer Dim y As Integer Dim z As Integer 'set error handler On Error GoTo Copier_Error 'turn off screen updating and calculation Application.ScreenUpdating = False Application.Calculation = xlCalculationManual 'check if the workbook isshared and exit if it is If ThisWorkbook.MultiUserEditing Then MsgBox "Please Unshare the workbook before you proceed" Exit Sub End If 'check that all values are in the userform If Me.txtName = "" Or Me.cboNum = "" Or Me.cboNumSt = "" Then MsgBox "You forgot to add the parematers for the sheet name." Exit Sub End If 'protect_all Protect_All 'set variables for number of sheet x = Me.cboNum.Value 'set variable for sheet name prefix y = Me.cboNumSt.Value z = x + y – 1 'check the first sheet name NewName = Sheet1.Range("A4") 'loop through to check For Each sh In ThisWorkbook.Worksheets If sh.Name = NewName Then MsgBox "This information already exists.You are not permitted to copy over it" 'if sheet name exists then got to end of sub GoTo Copier_Error: End If Next 'run loop to add sheets For numtimes = y To z Sheet3.Copy after:=Worksheets(Worksheets.Count) 'create the new sheet name ActiveSheet.Name = Me.txtName & numtimes Next 'return to Interface sheet Sheet1.Select 'list workshhet names on the interface ListWorkSheetNames 'turn of screen updating and calculation Application.ScreenUpdating = True Application.Calculation = xlCalculationAutomatic 'error handler On Error GoTo 0 Exit Sub Copier_Error: 'message if sheet already exists MsgBox "I think " & NewName & " already exists. Check the starting number" End Sub
|Getting error in connectionstring with Excel.||30||31|
|how to delete specific files and folders with VBA||3||25|
|Excel Calculate Average - Grouped Values||7||23|
|Fast way to Match on IP address from one worksheet and match results on the next worksheet||4||20|