VBA novice here
When I run my code I receive the error "Sub or Function not defined". This occurs in one of my subroutines. The first line is highlighted in yellow by the debugger.
Sub Description(Row As Integer, SheetName As String)
With Worksheet(SheetName)
.Cells(Row, 1) = ActiveCell.Offset(0, -3)
.Cells(Row, 2) = ActiveCell.Offset(0, -2)
.Cells(Row, 3) = ActiveCell.Offset(0, -1)
End With
End Sub
This subroutine takes in a number and a string. I want to copy specific descriptions into into another worksheet "SheetName". Here is a piece of the code prior to the subroutine call. The value of "x" is declared outside the loops scope.
string_temp = "Sheet2"
ActiveSheet.Cells(i, 5).Select
Call Description(x, string_temp)
x= x + 1
Appreciate the help!
Worksheets, notworksheet.