excel vba working with worksheetfunction -
this question has answer here:
- why range work, not cells? 1 answer
hi have quick question implementing worksheetfuncion across multiple sheets. don't quite understand why code produces application defined or object defined error in line
count = application.worksheetfunction.countblank(ws.range(cells(2, 6), cells(14, 6)))
a portion of code shown below
dim ws worksheet dim integer, j integer, k integer, x integer, y integer, z integer dim lastrow integer, lastcoln integer dim rowht double dim count integer, total integer lastrow = sheet2.usedrange.row - 1 + sheet2.usedrange.rows.count lastcoln = sheet2.usedrange.column - 1 + sheet2.usedrange.columns.count each ws in thisworkbook.worksheets if ws.name <> "legend" , ws.name <> "master schedule" lastrow = ws.usedrange.rows.count ws.range("a" & lastrow + 1) = "total crew count: " & lastrow - 1 j = 6 lastcoln count = application.worksheetfunction.countblank(ws.range(cells(2, 6), cells(14, 6))) next j end if next ws
thank help. appreciated!
change count = application.worksheetfunction.countblank(ws.range(cells(2, 6), cells(14, 6)))
count = application.worksheetfunction.countblank(ws.range(ws.cells(2, 6), ws.cells(14, 6)))
Comments
Post a Comment