Please can someone help with this simple error, which I cannot seem to understand...
In the attached workbook there are two worksheets.
I have a macro to set a range on the inactive sheet by clicking a command button on the active sheet.
It appears that to set a range, the sheet has to be active, or returns an Error 1004 "object-defined or application-defined" error.
Am I missing something, or do I have to first activate the sheet where I want to set the range?
This is the code:
Dim NewRange As Range
Dim ListofVendors As String
'Set Range you wish to use (NewRange)
Set NewRange = _
Sheets("ThirdNews").Range(Cells(1, 1), Cells(1, 1).End(xlDown))
ActiveWorkbook.Names.Add Name:="ListofVendors", RefersTo:=NewRange
Thanks very much