Workbooks(watP).Activate
activates the workbook with a name, in the variable watP
. The active worksheet is not mentioned. To see the ActiveSheet
, run this:
Workbooks(watP).Activate
MsgBox ActiveWorkbook.ActiveSheet.Name
Then, most probably somehow the cell A1
of the worksheet, displayed in MsgBox()
is not to be written into, because it is not the correct one you are expecting. Try this:
Sub TestMe()
Dim wbkName As String
Dim wksName As String
wbkName = "Book1" 'change it to the real name of the workbook
wksName = "Sheet5" 'change it to the real name of the worksheet
Workbooks(wbkName).Worksheets(wksName).Cells(1, 1) = "List"
End Sub
After some time, when you start feeling nice and accustomed to VBA, you may take a look at one of the best practices, discussed here - How to avoid using Select in Excel VBA.