A family of Microsoft spreadsheet software with tools for analyzing, charting, and communicating data.
Sheets(1).Name returns a string variable with the name of the worksheet. Then, since a string variable does not have a .Cells(...) property, VBA returns the error you encountered.
If you are interested in learning how to interpret code with references to multiple properties/methods, see
Case Study – Understanding code
http://www.tushar-mehta.com/excel/vba/vba-Understand%20code.htm
In the following code I get an 'Object Required' on the second likde of the subroutine. What is missing? The Sheets(1).Name function does work and returns the name of the first worksheet.
Thanks,
Dim Row As Integer
Dim TXFreq1High As Single
Sub Check_Data()
TXFreq1High = Sheets(1).Name.Cells(Row, P) + Sheets(1).Name.Cells(Row, N) / 2
TXFreq2Low = Sheets(1).Name.Cells(Row + 1, P) - Sheets(1).Name.Cells(Row + 1, N) / 2
End Sub
Tushar Mehta (Technology and Operations Consulting)
www.tushar-mehta.com (Excel and PowerPoint add-ins and tutorials)
Microsoft MVP Excel 2000-Present