VBAnewbie78
New Member
- Joined
- Apr 26, 2022
- Messages
- 2
- Office Version
- 365
- Platform
- Windows
Hi all,
I am a total newbie to VBA and have been saved many a times by this forum. I recently downloaded a template for a Call Center Audit Form and am getting a Syntax error message when running it through. This is where it is stopping me: shForm.Range("L10").Value = [Today()]
I am a total newbie to VBA and have been saved many a times by this forum. I recently downloaded a template for a Call Center Audit Form and am getting a Syntax error message when running it through. This is where it is stopping me: shForm.Range("L10").Value = [Today()]
VBA Code:
' Procedure to initialize the Cells, Controls
Sub InitializeSheet()
Application.ScreenUpdating = False
Dim shForm As Object
Set shForm = ThisWorkbook.Sheets("Form")
shForm.Activate
shForm.Unprotect Password:="thedatalabs"
'Employee & Other Details
shForm.Range("D9:D11").Value = ""
shForm.Range("H9:H11").Value = ""
shForm.Range("L9:L11").Value = ""
'Audit Score & Comments
shForm.Range("J32:J34").Value = ""
shForm.Range("L32:L34").Value = ""
shForm.Range("J38:J42").Value = ""
shForm.Range("L38:L42").Value = ""
shForm.Range("J46:J50").Value = ""
shForm.Range("L46:L50").Value = ""
shForm.Range("J54:J55").Value = ""
shForm.Range("L54:L55").Value = ""
shForm.Range("J59:J60").Value = ""
shForm.Range("L59:L60").Value = ""
' Feedbak/Remarks
shForm.Range("B64").Value = ""
'Adding Validation to feedback Shared Yes/No
shForm.Range("L11").Select
With Selection.Validation
.Delete
.Add Type:=xlValidateList, AlertStyle:=xlValidAlertStop, Operator:= _
xlBetween, Formula1:="Yes,No"
End With
'Adding Validation
'Greeting & Closing Script
shForm.Range("J32").Select
With Selection.Validation
.Delete
.Add Type:=xlValidateList, AlertStyle:=xlValidAlertStop, Operator:= _
xlBetween, Formula1:="Yes,No,N/A"
End With
shForm.Range("J33").Select
With Selection.Validation
.Delete
.Add Type:=xlValidateList, AlertStyle:=xlValidAlertStop, Operator:= _
xlBetween, Formula1:="Yes,No,N/A"
End With
shForm.Range("J34").Select
With Selection.Validation
.Delete
.Add Type:=xlValidateList, AlertStyle:=xlValidAlertStop, Operator:= _
xlBetween, Formula1:="Yes,No,N/A"
End With
'Courtesy & Communication
shForm.Range("J38").Select
With Selection.Validation
.Delete
.Add Type:=xlValidateList, AlertStyle:=xlValidAlertStop, Operator:= _
xlBetween, Formula1:="Yes,No,N/A"
End With
shForm.Range("J39").Select
With Selection.Validation
.Delete
.Add Type:=xlValidateList, AlertStyle:=xlValidAlertStop, Operator:= _
xlBetween, Formula1:="Yes,No,N/A"
End With
shForm.Range("J40").Select
With Selection.Validation
.Delete
.Add Type:=xlValidateList, AlertStyle:=xlValidAlertStop, Operator:= _
xlBetween, Formula1:="Yes,No,N/A"
End With
shForm.Range("J41").Select
With Selection.Validation
.Delete
.Add Type:=xlValidateList, AlertStyle:=xlValidAlertStop, Operator:= _
xlBetween, Formula1:="Yes,No,N/A"
End With
shForm.Range("J42").Select
With Selection.Validation
.Delete
.Add Type:=xlValidateList, AlertStyle:=xlValidAlertStop, Operator:= _
xlBetween, Formula1:="Yes,No,N/A"
End With
'Issue Resolution
shForm.Range("J46").Select
With Selection.Validation
.Delete
.Add Type:=xlValidateList, AlertStyle:=xlValidAlertStop, Operator:= _
xlBetween, Formula1:="Yes,No,N/A"
End With
shForm.Range("J47").Select
With Selection.Validation
.Delete
.Add Type:=xlValidateList, AlertStyle:=xlValidAlertStop, Operator:= _
xlBetween, Formula1:="Yes,No,N/A"
End With
shForm.Range("J48").Select
With Selection.Validation
.Delete
.Add Type:=xlValidateList, AlertStyle:=xlValidAlertStop, Operator:= _
xlBetween, Formula1:="Yes,No,N/A"
End With
shForm.Range("J49").Select
With Selection.Validation
.Delete
.Add Type:=xlValidateList, AlertStyle:=xlValidAlertStop, Operator:= _
xlBetween, Formula1:="Yes,No,N/A"
End With
shForm.Range("J50").Select
With Selection.Validation
.Delete
.Add Type:=xlValidateList, AlertStyle:=xlValidAlertStop, Operator:= _
xlBetween, Formula1:="Yes,No,N/A"
End With
'Case Documentation
shForm.Range("J54").Select
With Selection.Validation
.Delete
.Add Type:=xlValidateList, AlertStyle:=xlValidAlertStop, Operator:= _
xlBetween, Formula1:="Yes,No,N/A"
End With
shForm.Range("J55").Select
With Selection.Validation
.Delete
.Add Type:=xlValidateList, AlertStyle:=xlValidAlertStop, Operator:= _
xlBetween, Formula1:="Yes,No,N/A"
End With
'Process Compliance
shForm.Range("J59").Select
With Selection.Validation
.Delete
.Add Type:=xlValidateList, AlertStyle:=xlValidAlertStop, Operator:= _
xlBetween, Formula1:="Yes,No,N/A"
End With
shForm.Range("J60").Select
With Selection.Validation
.Delete
.Add Type:=xlValidateList, AlertStyle:=xlValidAlertStop, Operator:= _
xlBetween, Formula1:="Yes,No,N/A"
End With
shForm.Range("L9").Value = Application.UserName
[COLOR=rgb(147, 101, 184)] [/COLOR]shForm.Range("L10").Value = [Today()]
shForm.optYes = False
shForm.optNo = False
shForm.Activate
shForm.Range("D9").Select
ActiveWindow.ScrollRow = 8
ActiveWindow.ScrollColumn = 1
shForm.Protect Password:="thedatalabs"
Application.ScreenUpdating = True
End Sub