natekris8183
Board Regular
- Joined
- Mar 12, 2013
- Messages
- 156
All right, sort of a strange one here. I have finished putting together a cash order sheet (I work at a small credit union). While everything functions fine, the only complication is if someone needs to resubmit (or correct) an existing order. I've figured how to incorporate the Countifs VBA to search the associated columns for the matching data and obviously if it returns a value greater than 1 than the order already exists, BUT now it's navigating to the correct cell to replace the data (or copy/paste).
My gut tells me (when looking through some other forums, which I'll post an associated one below) is to use the .Find method but I don't see the ability to identify the multiple criteria (unless I attempt to do it using a concatenated set of variables, but I am not sure I'd know how to make them concatenate correctly for syntax purposes. Here's the scenario (and the layout is the same but far fewer columns for simplicity):
So I need to match the date AND branch, because they're multiple locations submitting orders for the same day. Currently on the order sheet I have a matching function as the following where it matches the date AND branch and then locates the previous order information by denomination
The concept would be the same but the vba .Find method would locate the cell in Column(A) with the same branch name (both variably set earlier through some other expressions) so that the copy/paste expression would copy over the existing data. thanks ahead to anyone that may be able to help!
This is the .Find forum where I think it is I need to start.
http://www.vbforums.com/showthread.php?634644-Excel-Find-Method-in-Excel-VBA-(Any-version-of-Excel)
My gut tells me (when looking through some other forums, which I'll post an associated one below) is to use the .Find method but I don't see the ability to identify the multiple criteria (unless I attempt to do it using a concatenated set of variables, but I am not sure I'd know how to make them concatenate correctly for syntax purposes. Here's the scenario (and the layout is the same but far fewer columns for simplicity):
Column(A): Date (Matching Criteria 1)
Column(B): Branch (Matching Criteria 2)
Column(C): Currency (associated data)
Column(D): Coin (associated data)
Column(E): Total (associated data)
Column(B): Branch (Matching Criteria 2)
Column(C): Currency (associated data)
Column(D): Coin (associated data)
Column(E): Total (associated data)
So I need to match the date AND branch, because they're multiple locations submitting orders for the same day. Currently on the order sheet I have a matching function as the following where it matches the date AND branch and then locates the previous order information by denomination
Code:
{=IF(COUNTIF(tblAllBranchData[Branch1],$D$4)>0,INDEX(tblAllBranchData,MATCH(MAX(IF(tblAllBranchData[Branch1]=$D$4,tblAllBranchData[Date]))&$D$4,tblAllBranchData[Date]&tblAllBranchData[Branch1],0),5),0)}
The concept would be the same but the vba .Find method would locate the cell in Column(A) with the same branch name (both variably set earlier through some other expressions) so that the copy/paste expression would copy over the existing data. thanks ahead to anyone that may be able to help!
This is the .Find forum where I think it is I need to start.
http://www.vbforums.com/showthread.php?634644-Excel-Find-Method-in-Excel-VBA-(Any-version-of-Excel)