I have a function in a module. The function is defined as follows:
Public Function CourseSetup(ByVal SROfferId As Integer) as string
When the function called, The following line fails:
Worksheets("CourseEvaluation").Range("CourseName").value = "1234"
fails with error 1004.
The same line in a sub (macro) works. CourseName
is a one cell named ranged. Getting the value for the above range works.
In the immediate window:
?Worksheets("CourseEvaluation").Range("CourseName").value
returns the current value in the range.