S
Steve Jorgensen
Hi all,
I've been an Access programmer for years, and I'm starting to try to clean up
my act code-wise so that all code is easy to read and expresses its intention
clearly and obviously. Now, I'm doing some work at a company that's doing
Excel macros that have evolved into full-blown data processing applications,
and looking at the code, it's a wonder anything works at all. Column
references are in A1 form, or referencing other columns on the same row via
offsets, and all variety of inscrutable things, hard to search/replace on if a
change needs to be made, and hard to determine the intention of to even kow if
they're working as intended, much less actually fix them.
Now, I started working up an example application to try to demonstrate how to
write legible code for Excel. For simple examples, it's no big deal. Define
named constants with the column names of the various columns, define a
constant for the number of rows in the header, get all the code that operates
on one type of sheet into one module, etc. When it gets just a little bit
more complicated than that, though, such as dynamic ranges of cells, multiple
sections with their own headers, etc., all my pretty coding conventions just
don't hold up.
The only solution I've been able to dream up is complex and involves using
some fairly complex (in implementation) new object modules that will be
unfamilliar to any other Excel programmers seeing them for the first time.
Can anyone point me in a better direction?
Thanks,
- Steve J.
I've been an Access programmer for years, and I'm starting to try to clean up
my act code-wise so that all code is easy to read and expresses its intention
clearly and obviously. Now, I'm doing some work at a company that's doing
Excel macros that have evolved into full-blown data processing applications,
and looking at the code, it's a wonder anything works at all. Column
references are in A1 form, or referencing other columns on the same row via
offsets, and all variety of inscrutable things, hard to search/replace on if a
change needs to be made, and hard to determine the intention of to even kow if
they're working as intended, much less actually fix them.
Now, I started working up an example application to try to demonstrate how to
write legible code for Excel. For simple examples, it's no big deal. Define
named constants with the column names of the various columns, define a
constant for the number of rows in the header, get all the code that operates
on one type of sheet into one module, etc. When it gets just a little bit
more complicated than that, though, such as dynamic ranges of cells, multiple
sections with their own headers, etc., all my pretty coding conventions just
don't hold up.
The only solution I've been able to dream up is complex and involves using
some fairly complex (in implementation) new object modules that will be
unfamilliar to any other Excel programmers seeing them for the first time.
Can anyone point me in a better direction?
Thanks,
- Steve J.