excel vba - Identifying last row in a inactive worksheet and copying data in last+1 row from active sheet -
i want know how can identify last row of inactive sheet (without passing control inactive sheet) , how past data row number: 'lastrow+1' active sheet. , still keep control active sheet.
i owner of small company , want create excel sheet monitor inventory. did littler bit of coding in vb 5 years remember littler of it. did write code task mentioned code of no use :) .... therefore not pasting here. appreciate help.
use following vba find next row in inactive sheet:
dim lastrow long lastrow = sheets("sheetname").cells.find("*", range("a1"), , , xlbyrows, xlprevious).row + 1 if have blank cells @ end add loop ad use findnextthis it:
dim c range, lastcell long set c = sheets("sheetname").cells.find("*", range("a1"), , , xlbyrows, xlprevious) if trim(c) = "" , not c nothing set c = .findnext(c) loop while trim(c) <> "" , not c nothing end if lastrow = c.row + 1
Comments
Post a Comment