alborg
Thu Jul 03 19:55:01 PDT 2008
Hi Raja:
The problem in your question is what do you mean by "form"? Are you
referring to a MS Word "UserForm", or are you referring to the template as a
"form"?
I suspect that you mean the latter, in which case I would make a macro that
is called by the checkmark object placed on your template, which I would then
have said macro call up a UserForm that does the calculations.
In the UserForm I think that you would need to do is to set up something
called an array, then pass the number to a sum total in a manner like:
Dim xx as String, xxx as String, ii as Integer, iii as Integer
iii = [value of project-to-date field] 'random not visible field on your form
Select Case xx.value
Case "Call Tim"
ii = 4
Case "Call Tom"
ii = 4
Case "Call Sally"
ii = 2
Case "Call Sue"
ii = 2
Case "pick up the kids"
ii = 1
Case "rent Ironman"
ii = 1
Case Else
Msgbox "Nothing has been selected!"
End Select
ii = iii + ii
[value of project-to-date field] = ii
xxx = str(ii)/14
[Textbox1Field] = "Project is now at the " & xxx & " point."
I've done something similar to this (i.e. calling up a UserForm from a
template object) in a "Charge Capture" template that I occasionally use to
follow patients. Notice how when I click on any one of the table field CPT
code fields*, a form pops up with a date passed on from the date on the same
line of the field in the table.
If you can refine exactly what you mean, then we can dive into how to do
this further.
* For those non-medical folks, CPT codes are used for billing, i.e. a
"99213" being an "intermediate visit".
URL for Charge Capture Template:
http://www.box.net/shared/static/1pdpez2g4k.zip
"Raja" wrote:
> I am new to the forums. I just got into an internship that requires a little
> bit of macro knowledge, and I do not know where to learn it. Do you guys
> know the best way to learn the basic commands of macros? Or at least a
> compilation of commands so I can piece together a semi-decent program?
>
> 1.) My first task is to read a column of cells containing tasks
> (Range(A6,E6)) and then quantify the colors of these words into a percentage.
> IE, there are 6 tasks written in column A6 to E6: 2 red statements saying
> Call Tim and Call Tom, 2 yellows saying call sally and call sue, and two
> black ones saying pick up the kids and rent Ironman. I want to say that the
> red ones qualify twice as much as the yellow ones; the yellow ones twice as
> much as the black ones; and the black ones simply as the base value.
>
> = For starters, I need to figure an algorithm to establish one red
> one as somehow being 4/ 14 of the project.
>
> 2.) When a check mark is placed by the task saying its complete, I need
> to figure out a way saying that 4/14 of this project is complete. This poses
> as a problem because I have no idea how to read a check box.
>
> = Confer a check mark as completing a certain percentage of the project.
>
>
> I really would like to learn how to do this. I enjoy problem solving and I
> think if I could somehow know the basics, I can solve this problem. I just
> have no idea where to look :4-dontkno.
>