Update SharePoint Choice FIeld with VBA

210 views Asked by At

I'm attempting to write a macro that sends info to a SharePoint list through an Excel workbook. However, I can't seem to find language to get it to select the desired value.

Public Function addtoSP(refRow As Integer, ws As Worksheet)
    Dim tbl     As ListObject
    Dim newR    As ListRow

    Set tbl = ws.ListObjects(1)
    Set newR = tbl.ListRows.Add

    With newR  
    .Range(6) = ws.Cells(i, 3).Value ' column 6 = choice field in SP. assignment error
    End With

end function
0

There are 0 answers