How do I make macro pull data from different sheets within a workbook. Excel VBA -
i'm having issue macro used pull information 1 worksheet another. cant figure out how make macro @ different worksheet within "currentschedule" workbook. when go through macro 1st (a line) worksheet runs smoothly, when try run through 2nd sheet (b line) times out. gets stuck @ line
" order = range("w1").offset(count, 0).value "
saporder = inputbox("enter sap order number:") prodline = inputbox("enter sheet# of currentschedule has sap order number. example: line = 1; b = 2") end select count = 0 'count row in designated column flag = true while flag workbooks("currentschedule.xlsx").worksheets(prodline).activate order = range("w1").offset(count, 0).value if order = saporder nme = range("b1").offset(count, 0).value
throw away stupid .activate
method learn how work this
sheets("sheetname").range("rangename/rangerange")[optional].cells("cellrow","cellcolumn")
it make job more easier, , can work sheet/range/cell object.
also, when use range/cell without dot , parent asignment, working active sheet, may unpredictable. if use full statement, mentioned above, cant make mistake.
Comments
Post a Comment