Hi Guys
I have a weird scenario which I cannot seem to figure out, maybe I am not seeing the problem. The code below is to copy values from multiple cells in a template to a Summary table on a different sheet in the same work work.
the excel file was created on my PC and I uploaded the file in teams for the rest of our department to work off/on. Firstly I had to set the Macro settings on every one's PC so there would not be any trust issues or disablement of macro _ Bear In Mind Not all of our team is experts in VBA, nir am for that matter....lol
Anyway this code works absolutely 100% on my PC and on one of the other team mates PC as well. But for some reason when a particuler team mate works on the file and clicks the command button I get a error from the code
the debug highlights the following issues
Sub Submit_AuditSheet_Data() and says that there is a issue with this line of code
lrow = ws_to.Cells(Rows.Count, "A").End(xlUp).Row
That is impossible as mentioned it works fine on my PC and second, the previous row is nit blank
Any idea why this is happening or is there a Options setting causing this ?
S
ub 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("C7").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
Dim cell As Range
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"
For Each cell In ws_from.Range("S26:S69")
If cell.Value = "No" And cell.Offset(, -1).Value <> "Repeat Finding" Then
lrow = lrow + 1
ws_to.Range("A" & lrow).Value = ws_from.Range("B" & cell.Row).Value
ws_to.Range("B" & lrow).Resize(1, 14).Value = cell.EntireRow.Columns("O:AB").Value
End If
Next cell
End Sub
Bookmarks