I'm simply trying to copy and paste between workbooks in VBA without first activating each workbook that I want to perform actions on.
My code stores the active workbook and sheet in variables before creating a new workbook after which cell A1 from the original workbook is supposed to be copied to the newly created one.
Option Explicit Sub test() Dim pLWB As Workbook Dim pLWS As Worksheet Set pLWB = ActiveWorkbook Set pLWS = ActiveSheet Workbooks.Add pLWB.pLWS.range("A1").copy End Sub
Any ideas where I am going wrong? I was under the impression that you can refer to very specific cells through
workbooks.worksheets.range but even as I was typing, the intellisense menu did not show
pLWS as an option.
Thank you in advance for your time.