dschroeder
New Member
- Joined
- Nov 21, 2011
- Messages
- 6
Is it possible to create a cell formula in Excel to reproduce the following macro? The items to find are account numbers and then the offset selects the dollar value for the found accounts. Thanks for any help-David
Windows("data file.xlsx").Activate
Columns("C:C").Select
Selection.Find(What:="21823", After:=ActiveCell, LookIn:=xlFormulas, _
LookAt:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, _
MatchCase:=False, SearchFormat:=False).Activate
ActiveCell.Offset(0, 2).Select
A = ActiveCell
Windows("data file.xlsx").Activate
Columns("C:C").Select
Selection.Find(What:="21825", After:=ActiveCell, LookIn:=xlFormulas, _
LookAt:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, _
MatchCase:=False, SearchFormat:=False).Activate
ActiveCell.Offset(0, 2).Select
B = ActiveCell
Range("E1") = A + B
Windows("data file.xlsx").Activate
Columns("C:C").Select
Selection.Find(What:="21823", After:=ActiveCell, LookIn:=xlFormulas, _
LookAt:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, _
MatchCase:=False, SearchFormat:=False).Activate
ActiveCell.Offset(0, 2).Select
A = ActiveCell
Windows("data file.xlsx").Activate
Columns("C:C").Select
Selection.Find(What:="21825", After:=ActiveCell, LookIn:=xlFormulas, _
LookAt:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, _
MatchCase:=False, SearchFormat:=False).Activate
ActiveCell.Offset(0, 2).Select
B = ActiveCell
Range("E1") = A + B