|
-
Aug 17th, 2007, 01:47 AM
#1
Thread Starter
New Member
if statement with monthcalendar
hello,
I'm new to VB and so do not know all the correct syntax required, thus I need your help. Globally, I'm trying to make an excel workbook to handle my expenses. I have a button to add an expense which brings up a windows form where you can enter the DATE (through a MonthCalendar), CATEGORY (through a combobox: food, travel or misc) and AMOUNT (through a textbox). What I would like the code to do is to put the information the user input into certain cells according to the DATE and CATEGORY.
For example, I'm looking for something like:
IF (DATE=weekday (of week 1 in a certain month) and CATEGORY=food) THEN
cell A1 = amount
IF (DATE=weekend (of week 1 in a certain month) and CATEGORY=food) THEN
cell A4 = amount
IF (DATE=weekday (of week 2 in a certain month) and CATEGORY=food) THEN
cell B1 = amount
IF (DATE=weekend (of week 2 in a certain month) and CATEGORY=food) THEN
cell B4 = amount
IF (DATE=week1 and CATEGORY = travel) THEN
cell K1 = amount
basically i'm splitting all my expenses up by their week where each week shows what i spent in food, misc and travel. within the food category, i want to split it between the weekday (mon-fri) and the weekend (sat&sun)
i'm using Visual Studio 2008 Pro and Excel 2003.
Thanks for your help!
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|