Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 18
Default Trying to revive this question... Help :)

I have a list of question in 2 sheets within the same workbook.

Those questions are risk evaluation for projects but depending on 5
criterias, project risk evaluation is modulated in 3 categories : low,
medium and high risk. In the case of Low risk, the first sheet is skipped
altogether and only certain questions on sheet 2 must be answered.

For medium risk, certain question of sheet 1 and 2 must be answered

For High risk, all questions of both sheets must be answered.

For low and medium risk, the questions are not necessarely sequential, i.e.
Q1, 3, 34, 45, etc...

Once answered, I already have a vba code taking all High risk evaluation
questions and copy them into a third sheet which is the contingency planning
for those risk.

MY PROBLEM / QUESTION : When the Evaluation Agent comes in the workgroup, I
want to have a first page interface where he must first answer those 5
questions to evaluate which category the project falls in. Then
automatically or by the push of a button, a questionnaire will popup asking
all questions identified in the appropriate risk group. Once the
questionnaire is answered, the vba code for contingency planning is
automatically executed and the agent is presented with this 3rd sheet.


Can this be done ? (I suppose yes) How ? Is there already an example
somewhere where I can elaborate and taylor to my need ? Of course, results
should be copied into each appropriate cells. Down the road, I plan to print
a summary of those questions/answers but I'm not there yet.

Thanks for any help you can provide me !



  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 158
Default Trying to revive this question... Help :)

There's many ways to tackle this. Here's one suggestion to point you in
the right direction.

My idea would be to use two forms (or even one). Form 1 would be used to
evaluate your initial risk level. This would set a public variable to 1,
2 or 3. Each question should have 1 2 or 3 against it in your Excel
worksheet.

You then loop through all of your questions. If the question has a risk
level equal to or less than your global risklevel variable then you
should, launch the Question form. Each time the user answers you store
their response on the appropriate sheet.

My reason for using this approach is that you can add and remove
questions as you see fit without having to change your code. You may
need to handle different types of questions - e.g. Boolean response,
Options, Strings, Dates etc. You could have a different form for each type.

Below I have sketched out the kind of approach I would use - it's very
incomplete. I haven't managed the answer writing properly for example.


'assumptions - column 1 of the questions

A B C D
Q1 My question RiskLevel AnswerColumn


Public RiskLevel as integer
Public MyAnswer as String

Sub StartQuestioning()

'Launch Evaluation Form
frmEvaluateInitialRisk.Show
'this process should set
RiskLevel = 1, 2 or 3

'Now loop through all the questions on your worksheets
with thisworbook
for each sh in .sheets
with sh
for i = 1 to .usedrange.rows.count
'check this row is a question
if left$(.cells(i,1),1) = "Q" then
if .cells(i,3) <=RiskLevel then

myAnswer = ""
frmAskQuestion.Display .cell(i,2)
'note that this requires a funciton in the form
'called 'display' that returns a string in myAnswer
'Function requires Question in argument
If myAnswer = "" then
'assume user aborted
exit sub
else
.cells(i,4) = myanswer
end if
else
.cells(i,4) = "NOT REQUIRED"
end if

end if
next i
end with
Next sh

End Sub


HTH,
Gareth


Junkyard Engineer wrote:
I have a list of question in 2 sheets within the same workbook.

Those questions are risk evaluation for projects but depending on 5
criterias, project risk evaluation is modulated in 3 categories : low,
medium and high risk. In the case of Low risk, the first sheet is skipped
altogether and only certain questions on sheet 2 must be answered.

For medium risk, certain question of sheet 1 and 2 must be answered

For High risk, all questions of both sheets must be answered.

For low and medium risk, the questions are not necessarely sequential, i.e.
Q1, 3, 34, 45, etc...

Once answered, I already have a vba code taking all High risk evaluation
questions and copy them into a third sheet which is the contingency planning
for those risk.

MY PROBLEM / QUESTION : When the Evaluation Agent comes in the workgroup, I
want to have a first page interface where he must first answer those 5
questions to evaluate which category the project falls in. Then
automatically or by the push of a button, a questionnaire will popup asking
all questions identified in the appropriate risk group. Once the
questionnaire is answered, the vba code for contingency planning is
automatically executed and the agent is presented with this 3rd sheet.


Can this be done ? (I suppose yes) How ? Is there already an example
somewhere where I can elaborate and taylor to my need ? Of course, results
should be copied into each appropriate cells. Down the road, I plan to print
a summary of those questions/answers but I'm not there yet.

Thanks for any help you can provide me !



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 18
Default Trying to revive this question... Help :)

Thanks ! That certainly is a good start.


"Gareth" a écrit dans le message de news:
...
There's many ways to tackle this. Here's one suggestion to point you in
the right direction.

My idea would be to use two forms (or even one). Form 1 would be used to
evaluate your initial risk level. This would set a public variable to 1, 2
or 3. Each question should have 1 2 or 3 against it in your Excel
worksheet.

You then loop through all of your questions. If the question has a risk
level equal to or less than your global risklevel variable then you
should, launch the Question form. Each time the user answers you store
their response on the appropriate sheet.

My reason for using this approach is that you can add and remove questions
as you see fit without having to change your code. You may need to handle
different types of questions - e.g. Boolean response, Options, Strings,
Dates etc. You could have a different form for each type.

Below I have sketched out the kind of approach I would use - it's very
incomplete. I haven't managed the answer writing properly for example.


'assumptions - column 1 of the questions

A B C D
Q1 My question RiskLevel AnswerColumn


Public RiskLevel as integer
Public MyAnswer as String

Sub StartQuestioning()

'Launch Evaluation Form
frmEvaluateInitialRisk.Show
'this process should set
RiskLevel = 1, 2 or 3

'Now loop through all the questions on your worksheets
with thisworbook
for each sh in .sheets
with sh
for i = 1 to .usedrange.rows.count
'check this row is a question
if left$(.cells(i,1),1) = "Q" then
if .cells(i,3) <=RiskLevel then

myAnswer = ""
frmAskQuestion.Display .cell(i,2)
'note that this requires a funciton in the form
'called 'display' that returns a string in myAnswer
'Function requires Question in argument
If myAnswer = "" then
'assume user aborted
exit sub
else
.cells(i,4) = myanswer
end if
else
.cells(i,4) = "NOT REQUIRED"
end if

end if
next i
end with
Next sh

End Sub


HTH,
Gareth


Junkyard Engineer wrote:
I have a list of question in 2 sheets within the same workbook.

Those questions are risk evaluation for projects but depending on 5
criterias, project risk evaluation is modulated in 3 categories : low,
medium and high risk. In the case of Low risk, the first sheet is skipped
altogether and only certain questions on sheet 2 must be answered.

For medium risk, certain question of sheet 1 and 2 must be answered

For High risk, all questions of both sheets must be answered.

For low and medium risk, the questions are not necessarely sequential,
i.e.
Q1, 3, 34, 45, etc...

Once answered, I already have a vba code taking all High risk evaluation
questions and copy them into a third sheet which is the contingency
planning
for those risk.

MY PROBLEM / QUESTION : When the Evaluation Agent comes in the workgroup,
I
want to have a first page interface where he must first answer those 5
questions to evaluate which category the project falls in. Then
automatically or by the push of a button, a questionnaire will popup
asking
all questions identified in the appropriate risk group. Once the
questionnaire is answered, the vba code for contingency planning is
automatically executed and the agent is presented with this 3rd sheet.


Can this be done ? (I suppose yes) How ? Is there already an example
somewhere where I can elaborate and taylor to my need ? Of course,
results
should be copied into each appropriate cells. Down the road, I plan to
print
a summary of those questions/answers but I'm not there yet.

Thanks for any help you can provide me !



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 158
Default Trying to revive this question... Help :)

You're welcome.

Junkyard Engineer wrote:
Thanks ! That certainly is a good start.


"Gareth" a écrit dans le message de news:
...

There's many ways to tackle this. Here's one suggestion to point you in
the right direction.

My idea would be to use two forms (or even one). Form 1 would be used to
evaluate your initial risk level. This would set a public variable to 1, 2
or 3. Each question should have 1 2 or 3 against it in your Excel
worksheet.

You then loop through all of your questions. If the question has a risk
level equal to or less than your global risklevel variable then you
should, launch the Question form. Each time the user answers you store
their response on the appropriate sheet.

My reason for using this approach is that you can add and remove questions
as you see fit without having to change your code. You may need to handle
different types of questions - e.g. Boolean response, Options, Strings,
Dates etc. You could have a different form for each type.

Below I have sketched out the kind of approach I would use - it's very
incomplete. I haven't managed the answer writing properly for example.


'assumptions - column 1 of the questions

A B C D
Q1 My question RiskLevel AnswerColumn


Public RiskLevel as integer
Public MyAnswer as String

Sub StartQuestioning()

'Launch Evaluation Form
frmEvaluateInitialRisk.Show
'this process should set
RiskLevel = 1, 2 or 3

'Now loop through all the questions on your worksheets
with thisworbook
for each sh in .sheets
with sh
for i = 1 to .usedrange.rows.count
'check this row is a question
if left$(.cells(i,1),1) = "Q" then
if .cells(i,3) <=RiskLevel then

myAnswer = ""
frmAskQuestion.Display .cell(i,2)
'note that this requires a funciton in the form
'called 'display' that returns a string in myAnswer
'Function requires Question in argument
If myAnswer = "" then
'assume user aborted
exit sub
else
.cells(i,4) = myanswer
end if
else
.cells(i,4) = "NOT REQUIRED"
end if

end if
next i
end with
Next sh

End Sub


HTH,
Gareth


Junkyard Engineer wrote:

I have a list of question in 2 sheets within the same workbook.

Those questions are risk evaluation for projects but depending on 5
criterias, project risk evaluation is modulated in 3 categories : low,
medium and high risk. In the case of Low risk, the first sheet is skipped
altogether and only certain questions on sheet 2 must be answered.

For medium risk, certain question of sheet 1 and 2 must be answered

For High risk, all questions of both sheets must be answered.

For low and medium risk, the questions are not necessarely sequential,
i.e.
Q1, 3, 34, 45, etc...

Once answered, I already have a vba code taking all High risk evaluation
questions and copy them into a third sheet which is the contingency
planning
for those risk.

MY PROBLEM / QUESTION : When the Evaluation Agent comes in the workgroup,
I
want to have a first page interface where he must first answer those 5
questions to evaluate which category the project falls in. Then
automatically or by the push of a button, a questionnaire will popup
asking
all questions identified in the appropriate risk group. Once the
questionnaire is answered, the vba code for contingency planning is
automatically executed and the agent is presented with this 3rd sheet.


Can this be done ? (I suppose yes) How ? Is there already an example
somewhere where I can elaborate and taylor to my need ? Of course,
results
should be copied into each appropriate cells. Down the road, I plan to
print
a summary of those questions/answers but I'm not there yet.

Thanks for any help you can provide me !




Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Excel 2007 Macro/VB Question DDE Question MadDog22 Excel Worksheet Functions 1 March 10th 10 01:47 AM
Good morning or good evening depending upon your location. I want to ask you the most important question of your life. Your joy or sorrow for all eternity depends upon your answer. The question is: Are you saved? It is not a question of how good davegb Excel Programming 1 May 6th 05 06:35 PM
Good morning or good evening depending upon your location. I want to ask you the most important question of your life. Your joy or sorrow for all eternity depends upon your answer. The question is: Are you saved? It is not a question of how good you [email protected] Excel Programming 0 April 27th 05 07:46 PM
Good morning or good evening depending upon your location. I want to ask you the most important question of your life. Your joy or sorrow for all eternity depends upon your answer. The question is: Are you saved? It is not a question of how good you [email protected] Excel Programming 23 April 23rd 05 09:26 PM
Good morning or good evening depending upon your location. I want to ask you the most important question of your life. Your joy or sorrow for all eternity depends upon your answer. The question is: Are you saved? It is not a question of how good you [email protected] Excel Programming 0 April 22nd 05 03:30 PM


All times are GMT +1. The time now is 05:22 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"