1
   

Help with Excel Macro (Modules)

 
 
Chai
 
Reply Fri 14 Mar, 2008 01:32 pm
Ok - I'm creating this for a person who has no need to understand the "whys", just needs to know where to click.

I have a workbook with 12 tabs, each one a separate hosptial.

The purpose is to list patients in each hospital, and some basic information.

I've already created macros so the user can click a button to add formated rows to the end for a new patient, and a button so they can delete a patient that has been discharged.

Now, I'm creating macros so patients can be transfered from one hospital to another (144 combinations, sheesh) at a click of a button.

I'm basically copying the code from one macro to the next, and just changing the hospital names.

Each module contains a macro, i.e. Main to Northside, Main to Southside, etc.

I'm not at all experienced in code, but here's a couple of questions I have.

Does each module only contain 1 macro?
If I can put more than 1 macro inside a module, how do I do it?

What exactly IS a module, is it just another name for, let's say, a bin or drawer a macro is stored in?

Also, I see Class Modules....Is this where I can move several modules for storage? Or does it do something else.

I'd like to have 12 different modules or sections for the 12 hospital, with all the variables for that hospital in one place, rather than have 144 modules, which looks like where I'm heading.
  • Topic Stats
  • Top Replies
  • Link to this Topic
Type: Discussion • Score: 1 • Views: 4,402 • Replies: 16
No top replies

 
DrewDad
 
  1  
Reply Fri 14 Mar, 2008 01:41 pm
Doing that in Excel sounds like a nightmare.

You need a database.
0 Replies
 
Chai
 
  1  
Reply Fri 14 Mar, 2008 01:44 pm
'splain please.

me no talkie this database lingo.

what is it of?
0 Replies
 
DrewDad
 
  1  
Reply Fri 14 Mar, 2008 01:51 pm
You're basically using Excel to create a patient database.

A database would let you create a record for each patient, with fields for info like name, address. You then link to a detail record for each malady for which they are receiving treatment, with details on doctor, condition, prognosis, etc. One field could be "hospital." When the patient is discharged you simply check a box.

You can even keep historical records, so you know all of the hospitals they've been treated at.

Microsoft Access has a whole bunch of database templates that you can use as a starting point.
0 Replies
 
DrewDad
 
  1  
Reply Fri 14 Mar, 2008 01:57 pm
And your work is being backed up, right?
0 Replies
 
Chai
 
  1  
Reply Fri 14 Mar, 2008 02:04 pm
Ok, here's the thing drewdad, I'm not going to be the one to populate this database, or keep up with it.

Also, although obviously intelligent, I'm giving this to the our nurses to use at one of the treatment rooms we have at the central hosptial.

For years, they have been using this funky white board, filling in names and erasing with markers. They just need something really simple to say Mr. Smith is discharged, for that I just assigned a macro that they just highlight that person and click the "discharged" button.

There's no reason for them to have a history of the patients, that's all done at another level. This is really a matter of KISS. I've got about 20 to 25 nurses, and I think only 3 or 4 of them will ever be looking at this.

To give you an idea, one of the nurses has a really low frustration level, and the first time you tell her to fill out a form, her heart will explode. The only info they need is name, room #, doc, and how long the treatment will be. Otherwise they are WAY too busy running around. They work really hard.

I'll look at the link, but, I know what I'm dealing with.

The scheduling is very dynamic, and can change from hour to hour.
0 Replies
 
Heeven
 
  1  
Reply Fri 14 Mar, 2008 02:05 pm
Your best bet would be to use a database (like Dad said) like Access.

Didn't like the sound of that button for deleting a patient. You know if you do that in excel the information that was there is gone forever, right? Can't pull back the info again to include in a report of discharged patients, etc.

If you use Access, you can insert a code or check-box to show only current patients and while discharged patients won't show their info is still there.
0 Replies
 
Chai
 
  1  
Reply Fri 14 Mar, 2008 02:05 pm
DrewDad wrote:
And your work is being backed up, right?


**** yeah, what do I look like, some kind of moron?





don't answer that.
0 Replies
 
Heeven
 
  1  
Reply Fri 14 Mar, 2008 02:06 pm
aw'right ne'mind my post. I see the people using this will not be interested in Access.
0 Replies
 
Chai
 
  1  
Reply Fri 14 Mar, 2008 02:09 pm
Heeven wrote:
Your best bet would be to use a database (like Dad said) like Access.

Didn't like the sound of that button for deleting a patient. You know if you do that in excel the information that was there is gone forever, right? Can't pull back the info again to include in a report of discharged patients, etc.

If you use Access, you can insert a code or check-box to show only current patients and while discharged patients won't show their info is still there.




ahem....trying to explain to someone how to delete rows would be a huge deal...., which I would have to teach over and over again....and I'd immediatley get calls saying they screwed something up.


ok, each week the nurses fax me their timecards, to my efax that starts with 866...

EVERY......SINGLE......WEEK.....this one nurse calls to tell me he can't get the fax to go through, and I have to remind him to dial a "1" before the number.

His response, EVERY.....SINGLE.....WEEK.....is "I always forget if I'm supposed to do that or not"

Your lives are in these people hands folks.
0 Replies
 
Heeven
 
  1  
Reply Fri 14 Mar, 2008 02:14 pm
Sometimes brilliant people can be dead stupid in everyday common sense things.

I usually have an excellent rapport with such people, calming them down and providing a very effective solution to their frustrations, just by saying "are you focking stupid, how many times do I have to tell/show you dumb-ass?"

Ah yes, I have a way about me. It's a beautiful thing.
0 Replies
 
Chai
 
  1  
Reply Fri 14 Mar, 2008 02:19 pm
Heeven wrote:
Sometimes brilliant people can be dead stupid in everyday common sense things.

I usually have an excellent rapport with such people, calming them down and providing a very effective solution to their frustrations, just by saying "are you focking stupid, how many times do I have to tell/show you dumb-ass?"

Ah yes, I have a way about me. It's a beautiful thing.



You and me heeven.



so...what about my marco modules?

what the flock is a "class module"?
0 Replies
 
George
 
  1  
Reply Fri 14 Mar, 2008 02:31 pm
Re: Help with Excel Macro (Modules)
Chai wrote:
...What exactly IS a module, is it just another name for, let's say, a bin or drawer a macro is stored in?...

Yes.
Chai wrote:
...Also, I see Class Modules....Is this where I can move several modules for storage? Or does it do something else?...

Are you familiar with object-oriented programming?
0 Replies
 
Heeven
 
  1  
Reply Fri 14 Mar, 2008 02:32 pm
I've no breedin' idea.

It that with a "1"?
0 Replies
 
Chai
 
  1  
Reply Sat 15 Mar, 2008 06:48 am
Re: Help with Excel Macro (Modules)
George wrote:
Chai wrote:
...What exactly IS a module, is it just another name for, let's say, a bin or drawer a macro is stored in?...

Yes.
Chai wrote:
...Also, I see Class Modules....Is this where I can move several modules for storage? Or does it do something else?...

Are you familiar with object-oriented programming?


okeydoak.

so, only one macro per module I take it?

Noooooo... don't know about oop.
So I guess a class module isn't like a folder whrere other modules are held?

You know george, when I open the code to the macro, it's like reading spanish...I know enough to have a general idea what it's doing, but could not have written it myself.

I've wanted to learn more about writing my own macros, but there seems to be this gap between finding between knowing nothing about how to do it, and, well, know how to do it.

For instance, when I googled "class module" excel macro.....and all the usual related terms, everything that came up was sophisticated beyond my understanding. Like you go from kindergarden to high school, and can find anything in between.

I find all these terms I don't understand, but can't find a source than defines them.

Can you suggest a site or book that teaches this, going from point A to point B, with all the stuff inbetween?




Heeven.....1? don't know what you mean.
0 Replies
 
George
 
  1  
Reply Sat 15 Mar, 2008 09:01 am
Well, first of all, the macros are written in VBA, variant of Basic. If you
can handle some simple programming in Basic, you should be OK with
VBA.

I was assigned to work on some Excel macros here and I bought a copy of
Excel 2000 Power Programming with VBA. I found it very helpful.
0 Replies
 
DrewDad
 
  1  
Reply Mon 17 Mar, 2008 07:13 am
Chai wrote:
For years, they have been using this funky white board, filling in names and erasing with markers. They just need something really simple to say Mr. Smith is discharged, for that I just assigned a macro that they just highlight that person and click the "discharged" button.

If you're just replacing a whiteboard, then why worry about having a separate worksheet for each hospital?

Put 'em all in one big worksheet, have a drop-down box for which hospital they're at or if they're discharged.

Then just have buttons to filter the view.
0 Replies
 
 

Related Topics

Clone of Micosoft Office - Question by Advocate
Do You Turn Off Your Computer at Night? - Discussion by Phoenix32890
The "Death" of the Computer Mouse - Discussion by Phoenix32890
Windows 10... - Discussion by Region Philbis
Surface Pro 3: What do you think? - Question by neologist
Windows 8 tips thread - Discussion by Wilso
GOOGLE CHROME - Question by Setanta
.Net and Firefox... - Discussion by gungasnake
Hacking a computer and remote access - Discussion by trying2learn
 
  1. Forums
  2. » Help with Excel Macro (Modules)
Copyright © 2024 MadLab, LLC :: Terms of Service :: Privacy Policy :: Page generated in 0.04 seconds on 05/04/2024 at 09:13:31