PartTimeExcel
New Member
- Joined
- Dec 9, 2020
- Messages
- 17
- Office Version
- 365
- Platform
- Windows
Hi, I'm trying to begin begin my macro by copying cells that have been preselected with by the mouse. My goal is to be able to paste those cells onto another worksheet as the first step of my macro. I've tried a number of variations, and this was my most recent one, but the variable "startrange" is empty:
Dim labinfo As Worksheet
Dim lab2p As Worksheet
Dim labprint As Workbook
Dim startrange As Range
Set labinfo = ThisWorkbook.Worksheets("Print Labels Data")
Set lab2p = ThisWorkbook.Worksheets("Print Labels")
Set labprint = Workbooks.Open("\\server2\aNAHVAC\DevShipping\FBA Labels\Barcodes\FBA Return Barcodes.xls")
Set startrange = Selection
labinfo.Range("c2") = startrange
Please advise what code would work to copy the cells are highlighted with the mouse, and then paste them onto another sheet.
Thanks!
Dim labinfo As Worksheet
Dim lab2p As Worksheet
Dim labprint As Workbook
Dim startrange As Range
Set labinfo = ThisWorkbook.Worksheets("Print Labels Data")
Set lab2p = ThisWorkbook.Worksheets("Print Labels")
Set labprint = Workbooks.Open("\\server2\aNAHVAC\DevShipping\FBA Labels\Barcodes\FBA Return Barcodes.xls")
Set startrange = Selection
labinfo.Range("c2") = startrange
Please advise what code would work to copy the cells are highlighted with the mouse, and then paste them onto another sheet.
Thanks!