Hi
I have the following worksheets:
- SECTION 1 - This worksheet acts like a questionnaire
- Action Plan
I would like the action plan to pick up any questions scored from 0-3 (ignoring any questions marked 'N/A'), which will then allow the user to input any actions in the 'grey' coloured cells etc. - see example
I do have further sections/questionnaire on separate worksheets and I would like macro to do the same - after finding the blank row in the action list.
I’m too good with my coding and hope someone can help or at least start me off – Many thanks!
Last edited by sgp; 01-30-2012 at 05:59 AM.
How would the other sheets be named in your workbook? I need to know this so i can code it accordingly.
Cheers,
Arlette
If I helped, Don't forget to add to my reputation (click on the star below the post)
Don't forget to mark threads as "Solved" (Thread Tools->Mark thread as Solved)
Use code tags when posting your VBA code: [code] Your code here [/code]
Hi..Other worksheets would be named as:
-Section 2
-Section 3
This would do for now, thanks for responding!
Any ideas??
Use this code -Option Explicit Dim i As Long Dim j As Long Dim lrow As Long Sub cons_data() For i = 1 To Worksheets.Count If Worksheets(i).Name Like "Section*" Then lrow = Worksheets(i).Range("B" & Rows.Count).End(xlUp).Row For j = 3 To lrow If Worksheets(i).Range("C" & j).Value <> "" And Worksheets(i).Range("B" & j).Value <> "Section Total" And _ Worksheets(i).Range("G" & j).Value <= 3 Then With Worksheets("Action") .Range("B" & Rows.Count).End(xlUp).Offset(1, 0).Value = Worksheets(i).Name .Range("C" & Rows.Count).End(xlUp).Offset(1, 0).Value = Worksheets(i).Range("B" & j).Value .Range("D" & Rows.Count).End(xlUp).Offset(1, 0).Value = Worksheets(i).Range("C" & j).Value .Range("E" & Rows.Count).End(xlUp).Offset(1, 0).Value = Worksheets(i).Range("G" & j).Value .Range("F" & Rows.Count).End(xlUp).Offset(1, 0).Value = Worksheets(i).Range("H" & j).Value End With End If Next j End If Next i End Sub
Cheers,
Arlette
If I helped, Don't forget to add to my reputation (click on the star below the post)
Don't forget to mark threads as "Solved" (Thread Tools->Mark thread as Solved)
Use code tags when posting your VBA code: [code] Your code here [/code]
Thanks that works great!! The only thing is that if a question is marked N/A the score should not go through - is this possible??
Also, I don't quite understand the code but I think it will take the same range for each worksheet (Section 1, Section 2 etc) - the range could be different and there may be more worksheets with different worksheet names other than 'Section X' - is there a way of saying changing this in the code so it only takes the current worksheet name and the current range with worksheet 'Action'?
Really appreciate your support!!! Thanks!
What do you mean by range could be different? Are there chances of the columns changing?
Cheers,
Arlette
If I helped, Don't forget to add to my reputation (click on the star below the post)
Don't forget to mark threads as "Solved" (Thread Tools->Mark thread as Solved)
Use code tags when posting your VBA code: [code] Your code here [/code]
As in the number of questions are different on each section
Columns will remain the same, thanks.
Actually the macro is designed to take in how many ever questions there are. So even if it varies from sheet to sheet, it will still include them. Will provide you an updated code regarding the other changes you have suggested, shortly.
Cheers,
Arlette
If I helped, Don't forget to add to my reputation (click on the star below the post)
Don't forget to mark threads as "Solved" (Thread Tools->Mark thread as Solved)
Use code tags when posting your VBA code: [code] Your code here [/code]
Great that seems perfect!!
Hi Arlette,
It would be very useful if there could also be some validation to the scoring where a score is required to questions marked as either YES or NO and then the relevant information is transferred across...I think this will solve all my problems!
Thanks.
Do u want the validation as part of the code or will you be inputting it manually?
Cheers,
Arlette
If I helped, Don't forget to add to my reputation (click on the star below the post)
Don't forget to mark threads as "Solved" (Thread Tools->Mark thread as Solved)
Use code tags when posting your VBA code: [code] Your code here [/code]
Not quiet sure what the difference would be or what would be easier but I was initially thinking as part of a code.
Regards.
I am a little stuck with the option boxes. Will research and revert to you shortly.
Cheers,
Arlette
If I helped, Don't forget to add to my reputation (click on the star below the post)
Don't forget to mark threads as "Solved" (Thread Tools->Mark thread as Solved)
Use code tags when posting your VBA code: [code] Your code here [/code]
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks