do I need a property

  • Thread starter Thread starter papa jonah
  • Start date Start date
P

papa jonah

I don't know what a property is or how to use it, but I suspect it
might give me the answer to a problem.

What my workbook is used for is the user pastes data on the sheet in
the workbook. With some macros, a copy of the workbook is made and
saved to a new file, a bunch of calcs are done and charts are made.
Then the user can replace the set of data and do it all again. And of
course a new file is generated. However, I want the date variable to
be consistently applied everytime the user runs the macros with new
data sets.

I have created a step in workbook_open that tells it to run a macro (in
1 of 4 modules) that will ask the user to determine if a constant date
will be used with every set of data they will run while the workbook is
open. As part of this code, a constant is set (1 or 0) that will be
used later in determining which path the code should go. This works
fine - the first time it is run. After the first set of data, the
constant resets to 0 and the constant date is no longer applied.

What I need to do (I think) is when the workbook is opened, have the
input box set a property(?) that will remain until the workbook is
closed. I would then hope that the property will remain in place
everytime the macros are run.

I hope all of that makes sense.
Thanks for your help.
 
Are you thinking that this property would replace the 'constant' that you
set? If so, then no, you don't need a property. A property is associated
with an object, or an object class, and it is an attribute of that object,
that is it describes some facet or feature of the object. For instance, a
cell has a interior object which has all sorts of properties that describe
it, such as its colour (color and/or colorindex), the pattern in the cell
(pattern), etc. Similarly, a class can have properties to describe that
class object.

I don't see what benefit creating a property would be in this case. Do you
actually have a problem with the code, or do you think a property is the
'right' way to go?

--

HTH

RP
(remove nothere from the email address if mailing direct)
 
Thanks for the response, Bob.

I thought I had a problem with the code, but now I think it may be
working (as far as it goes). Not understanding the function of a
"property" I was only suspecting that therein would my solution lie.
Thanks to you, I now have a better understanding of what properties are
actually used for.

Thanks again.
Papa J
 
Back
Top