excelnoob001
New Member
- Joined
- Jul 24, 2019
- Messages
- 26
Context: The dates that I'm trying to copy are side by side.
I am getting an error message when I run the code:
[/FONT]Error Message: Run-time error '91' Object Variable or with block variable not set.
Please Help! Thank you for your time!
I am getting an error message when I run the code:
Rich (BB code):
[FONT=Verdana,Arial,Tahoma,Calibri,Geneva,sans-serif]Public wsMT As Worksheet[/FONT]
[FONT=Verdana,Arial,Tahoma,Calibri,Geneva,sans-serif]Master_File = ThisWorkbook.Name[/FONT]
[FONT=Verdana,Arial,Tahoma,Calibri,Geneva,sans-serif]Set wbM = Workbooks(Master_File)[/FONT]
[FONT=Verdana,Arial,Tahoma,Calibri,Geneva,sans-serif]Set wsMT = wbM.Sheets("AllGridTemp")
[/FONT]
[FONT=Verdana,Arial,Tahoma,Calibri,Geneva,sans-serif][FONT=Verdana,Arial,Tahoma,Calibri,Geneva,sans-serif]wsMT.Range("C2:E2").Copy 'im getting an error here
Range("C6:E6").PasteSpecial Operation:=xlPasteValuesAndNumberFormats 'this line already refers to the activesheet, so I can just put Range("XXX")[/FONT]
[/FONT]Error Message: Run-time error '91' Object Variable or with block variable not set.
Please Help! Thank you for your time!