Hi Ashish, Thanks for the help. I do not want to loop this. In real time it would be only one lot at a time. Also the sample sheet contains identical lot list, whereas in my real sheet the main sheet has ~3000 entries. So the macro should look only for one lot at a time. This lot will be started in consumed sheet, so it has to take that lot ID and search in Main sheet and do the calculation against that lot.
Once again thank you Jaz On Saturday, March 9, 2013 11:02:57 PM UTC-8, ashish wrote: > > HI try this > > Sub sample() > Dim i As Long > Sheets("Main").Range("j2:j" & > Sheets("Main").Range("a1048576").End(xlUp).Row).ClearContents > Sheets("Main").Range("j2").Formula = > "=I2-VLOOKUP(Main!B2,Consumed!B2:D25,3,0)" > Sheets("Main").Range("j2:j" & > Sheets("Main").Range("a1048576").End(xlUp).Row).FillDown > End Sub > > Regards > Ashish > > On Sun, Mar 10, 2013 at 3:52 AM, Jaz <jaz...@gmail.com <javascript:>>wrote: > >> >> HI Shrini, >> I would appreciate if you can put this in a macro. It is doing exactly >> what I like. >> Thanks for helping. >> Jaz >> >> On Thursday, March 7, 2013 1:00:57 PM UTC-8, Jaz wrote: >>> >>> Hello all, >>> I am wondering if I can be helped in this. I have two sheets 'Main' & >>> 'Consumed' B col. of both sheets have Lot ID. >>> A macro should be written to see in Lot qty Cell D2 of sheet consumed, >>> check its lot ID in B2. Then go to Main sheet and trace the qty of that >>> lot in that sheet and subtract the amount. >>> I am attaching the sheet. >>> Thanks for your help. >>> Jaz >>> >> -- >> Are you =EXP(E:RT) or =NOT(EXP(E:RT)) in Excel? And do you wanna be? It’s >> =TIME(2,DO:IT,N:OW) ! Join official Facebook page of this forum @ >> https://www.facebook.com/discussexcel >> >> FORUM RULES >> >> 1) Use concise, accurate thread titles. Poor thread titles, like Please >> Help, Urgent, Need Help, Formula Problem, Code Problem, and Need Advice >> will not get quick attention or may not be answered. >> 2) Don't post a question in the thread of another member. >> 3) Don't post questions regarding breaking or bypassing any security >> measure. >> 4) Acknowledge the responses you receive, good or bad. >> 5) Jobs posting is not allowed. >> 6) Sharing copyrighted material and their links is not allowed. >> >> NOTE : Don't ever post confidential data in a workbook. Forum owners and >> members are not responsible for any loss. >> --- >> You received this message because you are subscribed to the Google Groups >> "MS EXCEL AND VBA MACROS" group. >> To unsubscribe from this group and stop receiving emails from it, send an >> email to excel-macros...@googlegroups.com <javascript:>. >> To post to this group, send email to excel-...@googlegroups.com<javascript:> >> . >> Visit this group at http://groups.google.com/group/excel-macros?hl=en. >> For more options, visit https://groups.google.com/groups/opt_out. >> >> >> > > > > -- > *Regards* > * * > *Ashish Koul* > > > *Visit* > *My Excel Blog <http://www.excelvbamacros.com/>* > Like Us on > Facebook<http://www.facebook.com/pages/Excel-VBA-Codes-Macros/151803898222297> > Join Us on Facebook <http://www.facebook.com/groups/163491717053198/> > > > P Before printing, think about the environment. > > > -- Are you =EXP(E:RT) or =NOT(EXP(E:RT)) in Excel? And do you wanna be? It’s =TIME(2,DO:IT,N:OW) ! Join official Facebook page of this forum @ https://www.facebook.com/discussexcel FORUM RULES 1) Use concise, accurate thread titles. Poor thread titles, like Please Help, Urgent, Need Help, Formula Problem, Code Problem, and Need Advice will not get quick attention or may not be answered. 2) Don't post a question in the thread of another member. 3) Don't post questions regarding breaking or bypassing any security measure. 4) Acknowledge the responses you receive, good or bad. 5) Jobs posting is not allowed. 6) Sharing copyrighted material and their links is not allowed. NOTE : Don't ever post confidential data in a workbook. Forum owners and members are not responsible for any loss. --- You received this message because you are subscribed to the Google Groups "MS EXCEL AND VBA MACROS" group. To unsubscribe from this group and stop receiving emails from it, send an email to excel-macros+unsubscr...@googlegroups.com. To post to this group, send email to excel-macros@googlegroups.com. Visit this group at http://groups.google.com/group/excel-macros?hl=en. For more options, visit https://groups.google.com/groups/opt_out.