Hi there ,
I am using a code below that copies certain cells (in many different sheets) to a main summary sheet "Audit_Summary_Sheet", these are random cells values pasted to range A2:U2 . This all works fine however;
I need to include with this code - (so as a second function), that the same command button copies specific rows with cell value to a sheet "Findings_Summary_Sheet, the trick here however is, if one of the cells value is "No", then it will be copied, if that same cell value is "Yes", then it will not be copied. I have tried to illustrate the cell name with its content below
Copy From: B26 (Date) paste to A, O26(Audit Finding) paste to B, P26(Recommended Action) paste to C, Q26(Responsible) paste to D, R26(Target Date) paste to E, S26(Completed) paste to F, T26(Reason) past to G , U26(Category) paste H
The cells must be copied on the Findings_Summary_Sheet" under the columns indicated "". The cell which contain the True (Yes) or False(No) is cell number S26 - as mentioned, if it is NO then the code should copy that row of cells
Also every time the command button is clicked (to update the two sheet 1 = "Audit_Summary_Sheet" 2= "Findings_Summary_Sheet" it will find the next open row so as to create a sting of historical data
The code I currently have is:
Code:
Function Submit_AuditSheet_Data()
Dim ws_to As Worksheet
Dim ws_from As Worksheet
Set ws_from = ActiveSheet
Set ws_to = Sheets("Audit_Summary_Sheet")
lrow = ws_to.Cells(Rows.Count, "A").End(xlUp).Row
' finds that last used row in column "A"
ws_to.Range("A" & lrow + 1).Value = ws_from.Range("C5").Value
ws_to.Range("B" & lrow + 1).Value = ws_from.Range("J5").Value
ws_to.Range("C" & lrow + 1).Value = ws_from.Range("J6").Value
ws_to.Range("D" & lrow + 1).Value = ws_from.Range("C12").Value
ws_to.Range("E" & lrow + 1).Value = ws_from.Range("J12").Value
ws_to.Range("F" & lrow + 1).Value = ws_from.Range("J7").Value
ws_to.Range("G" & lrow + 1).Value = ws_from.Range("C8").Value
ws_to.Range("H" & lrow + 1).Value = ws_from.Range("E7").Value
ws_to.Range("I" & lrow + 1).Value = ws_from.Range("D84").Value
ws_to.Range("J" & lrow + 1).Value = ws_from.Range("D91").Value
ws_to.Range("K" & lrow + 1).Value = ws_from.Range("E90").Value
ws_to.Range("L" & lrow + 1).Value = ws_from.Range("K99").Value
ws_to.Range("M" & lrow + 1).Value = ws_from.Range("K100").Value
ws_to.Range("N" & lrow + 1).Value = ws_from.Range("K101").Value
ws_to.Range("O" & lrow + 1).Value = ws_from.Range("K102").Value
ws_to.Range("P" & lrow + 1).Value = ws_from.Range("K103").Value
ws_to.Range("Q" & lrow + 1).Value = ws_from.Range("K104").Value
ws_to.Range("R" & lrow + 1).Value = ws_from.Range("K105").Value
ws_to.Range("S" & lrow + 1).Value = ws_from.Range("K106").Value
ws_to.Range("T" & lrow + 1).Value = ws_from.Range("K107").Value
ws_to.Range("U" & lrow + 1).Value = ws_from.Range("K108").Value
Set ws_from = ActiveSheet
Set ws_to = Sheets("Findings_Summary_Sheet")
lrow = ws_to.Cells(Rows.Count, "A").End(xlUp).Row
' finds that last used row in column "A"
ws_to.Range("D" & lrow + 1).Value = ws_from.Range("O26").Value
End Function
Apologies, I forgot to add the row range of the multiple questions is A25:U69 - all these rows are exactly the same with different questions and remarks