vba - Get first cell value after finding column header -
i want find first cell value after finding header.
currently have this:.
dim ulimitrange range dim llimitrange range ulimitrange = worksheets("sheet1").cells.find("upper limit", , xlvalues, xlwhole) llimitrange = worksheets("sheet1").cells.find("lower limit", , xlvalues, xlwhole) ulimit = range("ulimitrange" & 1) llimit = range("llimitrange" & 1)
however, returning "run-time error '91': object variable or block variable not set first line of code.
any
like this:
dim ulimitrange range dim llimitrange range set ulimitrange = worksheets("sheet1").cells.find("upper limit", , xlvalues, xlwhole) set llimitrange = worksheets("sheet1").cells.find("lower limit", , xlvalues, xlwhole) set ulimit = ulimitrange.offset(1) set llimit = llimitrange.offset(1)
comments:
- when setting range variables precede operation set statement
- if want move given range use offset procedure
offset([rows], [columns])
Comments
Post a Comment