I need your help writing some VBA codes.
I have two workbooks: Workbook1 has two sheets – Cash
Register and Suppliers; and Workbook2 has one sheet – Clients. The users of Workbook2 do not have access to Workbook1, and
information entered in Workbook2 is required (and has to be manually re-entered) in Workbook1.
I tried IFs and
VLOOKUPs to pull the data, but due to the large number of cells, the workbook is awfully slow – taking a very long time to
save (even with Automatic Calculation/Recalculate before save turned off).
I am using Excel 2007.
a user enters an ID number, which begins with either “S” (e.g., SB-00010) or “P” (e.g., PADA-012-034-0567), in column E of
If that ID number begins with “S”, I want the code to look up that ID number in
column A of Suppliers and copy the corresponding cell from each of the following columns:
and then paste them in the following columns of the Cash Register in the same row as the ID number looked up:
F (paste B)
G (paste C)
H (paste D)
I (paste E)
J (paste F)
K (paste G)
If the ID number begins with “P”, I want the code to look up that ID
number (e.g., PADA-012-034-0001) in column Q of Clients, and copy the corresponding cell from each of the following
and then paste them in the following columns of the Cash Register in the same row as the ID number looked
F - paste R;
H - paste AA (if it is not blank); add a hyphen (if AA is not blank); paste Z (e.g., 1625-123 Yonge Street)
I - paste AB
J - paste AC
K - paste AD
Thanks in advance for your help. I really appreciate it.