I am new to Excel VBA but have been using Excel for a few months and
hope you guys can help with a problem. I have a spreadsheet from which
I want to extract weekly totals. I can use Find to pick up the next
occurrence of a field and manually extract the information, but I
would like to use VBA to do this automatically. I have used the macro
recorder but this doesn't seem to help much.
Each row in my spreadsheet contains a reference and a balance (plus
other insignificant fields) within each week of the year. So, for
example, row 1 has a header "Week 1" (in cell A1); rows 2 - 47 each
contain reference (col A) and balance (col E); row 48 has the sum of
all the preceding balances (cell E48) and the word "Complete" in cell
H48.
Row 49 has a header "Week 2" (in cell A49); rows 50 to 107 with ref
and balance; cell E108 the sum of balances E50 to E107 and "Complete"
in H108. And this sequence repeats for each week of the year with
avariable number of rows each week.
What I want to do is to pick up the Week number from A1 and dump it
in, say, cell A1 of a separate sheet (called Summary). I then want to
find "Complete" and pick up the value 3 cells to the left (i.e. the
total in E48 and dump that in cell B1 of the Summary sheet. I will
then go to the next line (column A) to pick up the next week number
then look for the next occurrence of "Complete" to pick up the value 3
cells to the left so that my summary sheet contains each week number
is column A and the total balance for that week in col B. I am happy
using offset to move around the sheet but how do I find the next
occurrence of "Complete" and dump the data to another sheet using VBA?
I don't need a script writing for me - I just hope somebody can point
me in the right direction. I have tried looking through various sites
but, having spent a month on this, I can't find exactly what I'm
looking for.