I am trying to define two variables for use in concatened instructions. The variables are the 1st 3 letters of the worksheet and the overall worksheet name. The code is bombing at the first SET command when I try to define the first variable:
The error returned is:
Compile Error:
Sub or Function not defined.
Note: the function “=Mid(CELL("filename"), Find("]", CELL("filename")) + 1, 3)” returns the first 3 letters of the name of the worksheet in question
No doubt this is a simple syntax issue, but it escapes me.
Code:
Dim dn As String
Dim wsn As String
Set dn = Mid(CELL("filename"), Find("]", CELL("filename")) + 1, 3)
Set wsn = Mid(CELL("filename"), Find("]", CELL("filename")) + 1, 20)
Compile Error:
Sub or Function not defined.
Note: the function “=Mid(CELL("filename"), Find("]", CELL("filename")) + 1, 3)” returns the first 3 letters of the name of the worksheet in question
No doubt this is a simple syntax issue, but it escapes me.