Excel VBA PUT Json
我现在怎样才能使它工作?我试图从Y列(rng1)和Z列(rng2)中获取值Excel VBA PUT Json,json,excel,vba,Json,Excel,Vba,我现在怎样才能使它工作?我试图从Y列(rng1)和Z列(rng2)中获取值 我认为您需要使用offset来获取相邻的值,因此只需要一个循环。并使用和连接字符串 With ThisWorkbook.Worksheets("Fulcrum Upload") For Each rng1 In .Range("Y3:Y" & .Cells(.Rows.Count, "Y").End(xlUp).Row).SpecialCells(xlVisible) If Not
我认为您需要使用offset来获取相邻的值,因此只需要一个循环。并使用
和连接字符串
With ThisWorkbook.Worksheets("Fulcrum Upload")
For Each rng1 In .Range("Y3:Y" & .Cells(.Rows.Count, "Y").End(xlUp).Row).SpecialCells(xlVisible)
If Not IsEmpty(rng1) Then
With xhr
.Open "PUT", "https://api.fulcrumapp.com/api/v2/records/" & rng1.Offset(, 1).Value & ".json", False
.setRequestHeader "Accept", "application/json"
.setRequestHeader "Content-type", "application/json"
.setRequestHeader "X-ApiToken", "11111111"
.send rng1.Value
End With
End If
Next
End With
End Sub
令人惊叹的!很好用!
With ThisWorkbook.Worksheets("Fulcrum Upload")
For Each rng1 In .Range("Y3:Y" & .Cells(.Rows.Count, "Y").End(xlUp).Row).SpecialCells(xlVisible)
If Not IsEmpty(rng1) Then
With xhr
.Open "PUT", "https://api.fulcrumapp.com/api/v2/records/" & rng1.Offset(, 1).Value & ".json", False
.setRequestHeader "Accept", "application/json"
.setRequestHeader "Content-type", "application/json"
.setRequestHeader "X-ApiToken", "11111111"
.send rng1.Value
End With
End If
Next
End With
End Sub