Hi All
I have created a COPY button and a CLEAR button on an Excel file. And I have been using it for 3 months without any problems.
Suddenly the Error below came out when I click COPY button. CLEAR button no problem. I just want to know, is this error related to my VBA code?
I have use below VBA code for this COPY button.
Sub Rectangle2_Click()
Dim ShtName As String
ShtName = Range("Z2").Value & " " & Range("H5").Value & " " & Range("V5").Value
If ShtName = "" Then
MsgBox "no name entered"
Exit Sub
ElseIf Evaluate("isref('" & ShtName & "'!A1)") Then
MsgBox "Sheet name " & ShtName & " is already used"
Exit Sub
End If
ActiveSheet.Copy , Sheets(Sheets.Count)
ActiveSheet.Name = ShtName
End Sub
I have created a COPY button and a CLEAR button on an Excel file. And I have been using it for 3 months without any problems.
Suddenly the Error below came out when I click COPY button. CLEAR button no problem. I just want to know, is this error related to my VBA code?
I have use below VBA code for this COPY button.
Sub Rectangle2_Click()
Dim ShtName As String
ShtName = Range("Z2").Value & " " & Range("H5").Value & " " & Range("V5").Value
If ShtName = "" Then
MsgBox "no name entered"
Exit Sub
ElseIf Evaluate("isref('" & ShtName & "'!A1)") Then
MsgBox "Sheet name " & ShtName & " is already used"
Exit Sub
End If
ActiveSheet.Copy , Sheets(Sheets.Count)
ActiveSheet.Name = ShtName
End Sub