I want to have a macro that first activates a particular worksheet and then selects a particular cell. However, when I run the code below I get the following message:
Run-time error:'1004': Select method of Range class failed.
What am I doing wrong?
Function selectingCells(myWs As String, myCell As Range)
Sheets(myWs).Activate
myCell.Select
End Function
Sub callingFunction()
Call selectingCells("Data", Range("A1"))
Call selectingCells("Picklist", Range("A1"))
End Sub