Budget Set Up

Z

zoomzoom632

Please view my Excel files to better understand what I am talking about...
http://www.geocities.com/bushiebrow2000/Fall_2008_Budget_Test_Sample.xls

On the "Budget Breakdown" have a variety of listed items (Line Items). I
want any data on the "Running Budget" that lists C, F, G, H, or I under the
"Line Item" column to appear on it's own tab.

I have already created the tabs, thus everything listed on "Running Budget"
tab with "F" in the line item column would also be list on the tab called
"Line Item F". Only items with "F" in the line item column would be listed
on the tab "Line Item F".

I hope this make sense, please help if you can, thanks.
 
B

Bob Bridges

Ok, I'm looking at your spreadsheet, and your description seems pretty good,
but I'm puzzled about one thing: You say you want (for example) any row in
the Budget Breakdown tab that is marked line item C to appear also in the tab
named Line Item C. But what column(s) are to appear on that tab? I don't
see that the two tabs have any columns in common.
 
Z

zoomzoom632

Sir,

I want the Running Budget with the columns to match with the specified tab.
The "Budget Breakdown" will just keep a calculation that I will enter, that
tab just lists the "Line Items" and starting amount.
 
B

Bob Bridges

Yes, I got the part about wanting the line items in Running --

Oh, RUNNING Budget! I misread; I thought we were getting columns from
Budget Breakdown. Ok, let me look again.... Well, it seems to me you just
want an IF in each cell that you want copied from Running Budget. Something
like this in 'Line Item C'!A3, for example::

=IF('Running Budget'!$B3="C",'Running Budget'!A3,"")

See whether you can figure out what that does, and ask questions if you have
problems with it.
 
B

Bob Bridges

Mm...I hope you mean "column", not "row", because I was prepared to hear you
say the former. The problem with my suggestion, as I see it, is that it
leaves your rows displayed correctly, after a fashion, but with the gaps
between them that in the source sheet are filled with other line items. So
if on the Running-Budget sheet starting on line 3 you have line items C, G,
C, H, H, C and G, then the sheet for item C will have data on lines 3, 5 and
8, whereas you want them on lines 3, 4 and 5. Right?

Well, you CAN do this with formulae, but it's pretty messy. Much better, I
think, to do it in a VBA program. Are you up for that, or do you really,
really prefer to do it with worksheet functions?
 
Z

zoomzoom632

Yeah,

That's exactly what I mean. The other thing is that I do not know what a
VBA Program is.

Thanks.
 
B

Bob Bridges

Well, a "program" in general is a series of instructions or steps. Something
like this:

1) Create a variable, call it "base" and set it to 1
2) Ask the user to type in a number, and call the number "power"
3) Do the next two steps "power" times:
4) Multiply "base" by 2
5) Display a window showing the new value of "base" (ie 2, 4, 8, 16 etc)
6) Display a window saying "That's all!" and stop

A program like the above would get you to type in a power, and it would then
display two to each power from 1 up to the top limit you typed in. That's a
pretty simple program, but there's no theoretical limit to how complex and
intelligent a program you can write: As long as you can figure out what
instructions will accomplish your purpose, you can write a program to do it.
Doing what you want to do in this case wouldn't be very hard, once you know
how it works -- simpler, in my opinion, than doing the same thing with Excel
worksheet functions and formulae.

VBA is a particular language for doing this kind of thing -- a "language" in
the same sense that the Excel worksheet functions themselves could be
considered a "language" -- and it comes with Excel, so you already have the
tools you need to do much fancier things than the Excel worsheet functions
can do for you. (Don't get me wrong; I think the Excel worksheet functions
are pretty darned useful.) What you may not have is the interest it takes to
learn to write these programs: Some people think it is the neatest thing
since codes and decryption, and other people burst into tears of misery after
the first half hour's exposure. I'm one of the former, and so are a lot of
other people here, but if you're not then you're probably stuck with using
the formulae, which for your purpose is possible but pretty complicated; a
program would be simpler, but only if you find you have any interest in
writing program at all.

(Me, I thought it sounded boring back when my best friend described it; I
took a class in it only reluctantly, thinking in my chosen profession I
should know something about it. To my surprise it was utterly fascinating; I
still routinely find myself up at three in the morning because I "just want
to figure out this one thing".)

So here's the thing: If you want to get an introduction to VBA programming,
contact me via email and I can take you far enough a) to discover whether
this sort of thing is for you, and if it is then b) to get your program
written. No need to feel reluctant on my behalf: I make such offers it's
fun for me, so you won't catch me complaining later, and if I get too busy
I'll just say so.

If learning how to make Excel do much fancier things than you've thought of
so far sounds boring, too much like work, there's no shame in that; I'll give
you a brief outline of how I'd do it with formulae and we'll see whether you
like that option better. Me, I think learning more programming stuff is just
plain neat, so don't let my enthusiasm talk you into trying something you'd
really rather not bother with.
 
Z

zoomzoom632

Mr. Bridges,

Thank you for the help, I briefly looked at the VBA program, and I don't
really have the time to figure it out.

Thank again.
 
B

Bob Bridges

Right, here's how you can do it with Excel's built-in functions. You'll need
a few helper cells and columns. You can put them anywhere, but here's how I
did it in your workbook, using Line Item F as the sample sheet:

I1: The literal "F". (This enables you to use the same formulae on each of
the other line-item sheets.)

J1: ="'Running Budget'!"; this way if you rename that sheet some time down
the road you don't have to go through all your sheets, rows and columns and
rework all the formulae.

I2: =ROW('Running Budget'!B2), to start your first search.

J3: =$J$1&"B"&I2+1&":B999" constructs the address of the area you'll search
for the next "F". In J3 the result is " 'Running Budget'!B3:B999".

I3: =MATCH(I$1,INDIRECT(J3),0)+I2 finds the NEXT occurence of "F" in the
Running Budget sheet, starting in the row after the previous "F" (which in
this first case means starting in row 3). I3's result is 5, which you can
confirm by looking in the Running Budget sheet and seeing that line-item F
first appears on row 5.

After that, J4 shows 'Running Budget'!B6:B999 and I4 is 11, and so on.

That gets you, with a lot of hemming and hawing, to the same information
without blank spaces. For columns A through E use something like this:

=IF(ISERROR($I3),"",INDIRECT($J$1&"R"&$I3&"C"&COLUMN(),FALSE))

....(you'll want to look up that R1C1 notation if you don't already know what
it is, but maybe you do). That pulls in the proper data for the next F row
from the Running-Budget sheet.

There are odds and ends to clean up but maybe this gives you the idea.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top