Hello Friends, anyone can help me, please.
I want find the data in some rows that same with one or more cell and automatically fill the data. And for more details, I have attached the examp file (Examp.xls).
Thank's before for your helps.
Antoni![]()
Hello Friends, anyone can help me, please.
I want find the data in some rows that same with one or more cell and automatically fill the data. And for more details, I have attached the examp file (Examp.xls).
Thank's before for your helps.
Antoni![]()
Last edited by antoni; 08-25-2009 at 10:11 PM.
Like so:
![]()
Sub Process() 'JBeaucaire (8/17/2009) If IsEmpty(Range("L8")) Then MsgBox "Please fill in a Lot #" Exit Sub ElseIf IsEmpty(Range("L10")) Then MsgBox "Please fill in a Location #" Exit Sub ElseIf IsEmpty(Range("L12")) Then MsgBox "Please fill in a QTY of use" Exit Sub End If Dim LR As Long, cell As Range, Count As Long Count = Range("L12").Value LR = Range("B" & Rows.Count).End(xlUp).Row For Each cell In Range("B8:B" & LR) If cell = Range("L10") Then Cells(cell.Row, "D") = Range("L8") If Cells(cell.Row, "C") < Count Then Cells(cell.Row, "E").Value = Cells(cell.Row, "C").Value Count = Count - Cells(cell.Row, "C") ElseIf Count > 0 Then Cells(cell.Row, "E") = Cells(cell.Row, "C").Value - Count Count = 0 End If End If Next cell End Sub
_________________
Microsoft MVP 2010 - Excel
Visit: Jerry Beaucaire's Excel Files & Macros
If you've been given good help, use theicon below to give reputation feedback, it is appreciated.
Always put your code between code tags. [CODE] your code here [/CODE]
?None of us is as good as all of us? - Ray Kroc
?Actually, I *am* a rocket scientist.? - JB (little ones count!)
Hello Mr. JBeaucaire thank's for your help.
it's nice code bro..![]()
Glad you like it!
If that takes care of your need, be sure to EDIT your original post, click Go Advanced and mark the PREFIX box [SOLVED].
(Also, use the blue "scales" icon in our posts to leave Reputation Feedback, it is appreciated)
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks