Dim Workbook Path. Set wk = thisworkbook set sh = wk.worksheets(1) set rg = sh.range(“a1:a10”) for i = 1 to rg.rows.count count = rg.value debug.print count next i. Set wb = workbooks(book1) the name of the workbook will be filename plus extension in case of a saved workbook, e.g.
Sub copy_paste() dim i as long dim lcurrow as long dim lrow as long dim wb as workbook for i = 1 to 1 step 1 set wb = workbooks.open(c:\jawahar works\new folder\multiple sheets promo msd\prom mdf _w.xlsb) with wb.sheets(mara) if i = 1 then lrow = 1 else lrow = 2 end if do until.range(a & lrow).value = vbnullstring lcurrow = lcurrow +. The chdrive won't work on network drives. If the workbook is closed, you will need to provide the full workbook path: