Year dependent macros help??? Its quite urgent : )
From: KrisB_bacon (KrisB_bacon.11qxle_at_excelforum-nospam.com)
Date: 02/17/04
- Next message: Debra Dalgleish: "Re: Programming using user forms"
- Previous message: martialtiger: "Re: Re: IF function with > but < arguments"
- Messages sorted by: [ date ] [ thread ]
Date: Mon, 16 Feb 2004 19:09:16 -0600
Dear Helpers,
I'm making a project to manage my school's geography department's
accounts and stock. I will try to explain my problems in as much detail
as possible within my capabilities.
I have recieved help from people such as yourselves before, but
advanced knowledge over mine has led to me making mistakes. I really
need some help again. Please see my attached spreadsheet. Please e-mail
me at KrisB_bacon@hotmail.com if you have any queries/would prefer
e-mail correspondence.
Here we go:
When you open the worksheet, you are requested to select the current
year. This allows a year to be input into H23 in the Temp worksheet.
This is then looked up in the Fieldtrips worksheet and it's macros.
This is the year dependency I am using at the moment. This is part of
my desire to run macros according to what year it is. Previous help
from this website has helped me to write macros and thier buttons to
run the No_fieldtrips
Location: Fieldtrips! worksheet
When the user presses the "Edit a Summer Fieldtrip" button, a macro is
run (called Fieldtrip_form) that displays a user form (called
Fieldtripform). This user form asks the user to select a year from the
list and either click a Yes or a No button. My problem lies in the Yes
button and in the userform run after clicking the No
button(no_fieldtrip_selection). I have recieved help before that
resulted in trying to type VB code that would result in, when the user
presses the Yes button, a Yes would be placed in the correct cell
(D4,D5,D6,D7,D8,D9 or D10) according to the year that was selected.
However, when I click on the Yes button a compile error message appears
("compile error: invalid use of property") and I cannot find the
solution to the problem. Can you help?
Meanwhile when the No button is clicked, the no_fieldtrip_selection
userform is displayed as intended.
When the user clicks on the No button, it runs another userform
(no_fieldtrip_selection) and they select what year DOESN'T have a
fieldtrip. I thought this work fine.
However, when one of the buttons in this no_fieldtrip_selectioin
userform is clicked on, the macro doesn't work and a run time error
appears (when 2003 is clicked, a run-time error '424' message is
displayed) or a compile error appears (when 2005 is clicked, a compile
error is displayed). You can view this yourself as I have attached my
system with this posting. I think the solution lies in my input of the
complicated code that was suggested. I think it has many mistakes
within it. I have little knowledge of the m_Col function(s) in VB. It
would be very helpful if you could explain what happens/what the code
does, so that I could use it in the future. The other function that I
do not fully understand is the If cell.....offset..(e.g. If cell -
Val(FieldTripYear) Then) function. The previous helper set up the No
button and used the NoFieldtrips macro. Can this macro be used on any
column needed (any year) by just using the m_Col command? Can I do it
another way? Do I have to create a similar macro for each year (just
changing the cells where appropriate.......tedious) or is there a short
way to do it?
If you could help solve these problems it would make my life so much
easier and I would be eternally grateful. Thx a lot for the help.
KrisB_bacon
Attachment filename: geo system.xls
Download attachment: http://www.excelforum.com/attachment.php?postid=444491
--- Message posted from http://www.ExcelForum.com/
- Next message: Debra Dalgleish: "Re: Programming using user forms"
- Previous message: martialtiger: "Re: Re: IF function with > but < arguments"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|