I am very new at vba programming, and I will try to make this simple to understand.
I have 2 sheets in a workbook right now.
One is a daily log and one is for invoicing.
Right now what I am trying to do is this.
Someone hits a command button in the invoicing page
and it searches through Column D or a unique key field of the daily log page to find a match to the name on the invoicing page.
Then when it finds a match the code is suppose to do this.
Here is my current code
Dim x as string
x = Sheet2(Invoicing).range("Agent").value
Sheet1.Range("D4").select
If activecell = x then
Sheet2.range("A19").value = activecell.offset(0,1)
Sheet2.range("B19)").value = activecell.offset(0,2)
My question is how do I get the code to the find the next time that name appears on the daily log sheet. Say the agent has 10 orders. Also, when the code runs it needs to put the next values 2 rows or lines down in the Invoicing page.
So If agent abc is on line D4 of Sheet1 it would print the value in a19 of sheet 2 and the 2nd value in cell b19. Then the code would look for the next time that name would appear say D10 then put that value in a21 and b21, and so on a23 and b23 for next appearance.
I would appreciate any help.
Thanks
Bookmarks