Difficult macro for a VBA novice (info in 1st post got messed up)
Posted by Felicia P. on July 15, 2000 12:04 PM
I have to key in every month hours spend for various accounts. The spreadsheet is setup in Jan for all 12 months and has zero already in all cells.
If I have a new account in a month, I have to insert a new row and enter the account name (can have any number of letters) and #(3 digits).
Accounts are not in alfabetical or numerical order.
To simplify this example I'll use only the first 3 months.
In this example Jan and Feb are already done; the reporting month is March.
A2 ABCDE (012)
A3 EFG (021)
A4 HIJL (055)
A5 MNOPQRS (034)
I want to set up columns E and F as the Current Month Reporting area where I'll enter in E2 and down the accounts for which I have hours in March and
in F2 and down I'll enter number of hours for the accounts listed in E2 and down.
After I enter the current month data, a macro should do the following:
look after the first account in column E (055) find it in column A and copy the corresponding hours from column F in the current month column (D1).
In case that an account in column E is new (can not be found in column A) a message box should say "You have to insert a new row for new account." and the macro to stop until the new row is inserted and resume to run after that.
I am new at macros and perhaps it can not do all these but any suggestions will be greatly appreciated.
Thank you in advance.