Sheet1.Range("k4:n50").Cells.Value returns a two dimensional array of variants. In VBA you can't compare all of the elements of an array in one swoop using the = operator.
First of all, some terminology:
workbooks and
spreadsheets are the same thing. "Looking for an empty workbook in a spreadsheet" doesn't make sense.
The core hierachy in the Excel object model is:
Code:
Application
|
Workbooks - a collection of all of the open workbooks
|
Workbook - an open workbook
|
Sheets - a collection of all of the sheets (worksheets, chart sheets, etc) in a workbook
|
Worksheet - a worksheet in a workbook
|
Range - a range on a worksheet
The best way to check if a range of multiple cells is empty is to use WorksheetFunction.CountA(). However, I am not convinced from the information on the thread so far that you want to check if a range is truly empty (as opposed to blank). Please can you describe in words what you want to do, and then I/we might be able to suggest something?
