Hi, folks. I need an excel hero – I’m a bit out of my depths.
I’ve designed a spreadsheet that creates a postage schedule report based on raw input from a .csv file produced by our postage meter.
Basically, I cut and paste the .csv file into a blank sheet, and use SUMIF to add up the charges for individual clients. My .csv file is typically about 1500 lines like this, dropped into a sheet named “meter file”:
1596 I 2/1/2007 10:56 2/1/2007 10:57 vr 1521 49 Letterpost 66 USA Std Letterpost 4 3.72 40 gm 0 3.72 $
1597 I 2/1/2007 10:57 2/1/2007 10:57 lms 578 49 Letterpost 66 USA Std Letterpost 1 0.93 10 gm 0 0.93 $
(The meter records jobs as they are done, so each property might have 50 separate entries.)
I get the total for each billed property with a formula like this:
=SUMIF('meter file'!E1:E3000,"=lms 578",'meter file'!M1:M3000)
Theoretically, I should just be able to drop my raw data in there and my report is done.
Unfortunately, I’m running into a slight problem – my total is out by a very small amount.
It appears that there is at least one “customer ID” in the meter file that isn’t referenced in the spreadsheet. Trying to locate it is driving me up the wall, and I know that this will happen in the future as new clients are added to the meter.
What I would like to do is to run a macro that looks at each row in the “meter file” sheet and checks to see if the text in column “E” appears in the formula in column “D” of the sheet with my report spreadsheet in it, and make it clear if it fails the test. (Either put a mark in a cell on that row, or change the colour of the row, or hide every row that passes the test, whatever, it doesn’t matter.)
Unfortunately, I am wet-behind-the-ears with VBA, and don’t really know how to approach string manipulation.
Is that clear? I need to get the contents of Cell “E” of each row in the sheet “meter file,” (call it “Customer_ID”) and then confirm that there is a cell in column “D” of the sheet called “schedule” which contains the text =SUMIF(‘meter file’!E1:E3000,"=Customer_ID",‘meter file’!M1:M3000)
So I should be able to drop my data in, check to see if the total on the sheet matches the total from the meter file, and if it doesn’t — run the macro, see which properties aren’t referenced in the sheet, fix it up, and print.
I know this should be easy, but I’m getting a headache trying to find out how to do it through online tutorials and whatnot.
Can anyone give me a clue?
Thanks!