Hi guys! New to the forum! Need help please!
I have a macro that pulls in data from a SharePoint List. I then want to update a value in a column but it's not updating. No errors or anything, values are just not getting updated.
Sub Refresh_From_SharePoint()
'
Sheets("Data").Select
' Selection.ListObject.QueryTable.Refresh BackgroundQuery:=False
Sheets("Data").ListObjects("Table_C_GRV").QueryTable.Refresh BackgroundQuery:=False
'
Call Update_Approval
Sheets("Approvals").Select
End Sub
Sub Update_Approval()
'this will get you the last row number in column "L"
lastRow = Sheets("Data").Cells(Sheets("Data").Rows.Count, "L").End(xlUp).Row
'loop through all cells in column "L" and replace text as needed
For i = 1 To lastRow
Sheets("Data").Cells(i, 2).Value = Replace(Sheets("Data").Cells(i, 2).Value, "TRUE", "Approved")
Sheets("Data").Cells(i, 2).Value = Replace(Sheets("Data").Cells(i, 2).Value, "FALSE", "UnApproved")
Next i
End Sub
Bookmarks