ChangetoFor j = 3 to lrowFor j = 5 to lrow
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]
Changed - however I get an error if a question is marked N/A - did not get this error on the example
Right click on the sheet where you need the validation and select "View Code" and input this codeHowever, i observed that you have grouped the radio buttons. I dont think this code will work properly in this case. Try ungrouping it and then it should work.Private Sub Worksheet_SelectionChange(ByVal Target As Range) If Range("I" & Target.Row).Value = "" Then MsgBox "Please enter score", vbCritical, "Enter Score:" Range("I" & Target.Row).Select End If 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]
What error do you get?
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 - will try to incorporate this.
I get runtime error 13
Type mismatch
I am not getting any error. Can you try again please?
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]
I'm still getting the same error on the attached example in post 28 - its only if you leave one/all question marked n/a
Did not get this error on the example though
Thanks
Ok got it. Since the last 2 rows dont need to be evaluated (they only contain titles), change your for statement tofor j = 5 to lrow -2
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. Got rid of error but the n/a mark is copying through now
Its just small small things that we ignore. Change this linetoFor j = 5 To lrow - 2 If Worksheets(i).Range("E" & j).Value <> "" And Worksheets(i).Range("D" & j).Value <> "Section Total" And _ Worksheets(i).Range("I" & j).Value <= 3 And Worksheets(i).Range("X" & j+1).Value <= 2 ThenFor j = 5 To lrow - 2 If Worksheets(i).Range("E" & j).Value <> "" And Worksheets(i).Range("D" & j).Value <> "Section Total" And _ Worksheets(i).Range("I" & j).Value <= 3 And Worksheets(i).Range("X" & j).Value <= 2 Then
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]
Brilllll!! Thank-you sooo much!
Change this part of your code fromtoWith 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 WithAlso, at the top of your code, add another DIM statement - Dim lastrow as longWith Worksheets("Action") lastrow=.range("B" & rows.count).end(xlup).row .Range("B" & lastrow).Value = Worksheets(i).Name .Range("C" & lastrow).Value = Worksheets(i).Range("B" & j).Value .Range("D" & lastrow).Value = Worksheets(i).Range("C" & j).Value .Range("E" & lastrow).Value = Worksheets(i).Range("G" & j).Value .Range("F" & lastrow).Value = Worksheets(i).Range("H" & j).Value End With
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 Arlette
Again due to different headings in my original document and my lack of knowledge i'm unable to get this to work.
Hope you could have a look for me.
Regards
Sorry my bad. The previous code that i gave you. Add a "+1" to the lastrow. In other words, it should read asWith Worksheets("Action") lastrow=.range("B" & rows.count).end(xlup).row .Range("B" & lastrow+1).Value = Worksheets(i).Name .Range("C" & lastrow+1).Value = Worksheets(i).Range("B" & j).Value .Range("D" & lastrow+1).Value = Worksheets(i).Range("C" & j).Value .Range("E" & lastrow+1).Value = Worksheets(i).Range("G" & j).Value .Range("F" & lastrow+1).Value = Worksheets(i).Range("H" & j).Value End With
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