I'm trying to convert below code from sending webhook when change done manually to when cells on the specific worksheet has been updated by formula, but without success.
I was trying to change "Private Sub Worksheet_Change" to "Private Sub Worksheet_Calculate" with many variations of the code, but each time some error occured.
Help is highly appreciated.
NOTE - in "" [/B]inside the code i'm adding re...ly, but not when cell was changed by formula.
I was trying to change "Private Sub Worksheet_Change" to "Private Sub Worksheet_Calculate" with many variations of the code, but each time some error occured.
Help is highly appreciated.
VBA Code:
Private Sub Worksheet_Change(ByVal Target As Range)
If Not Intersect(Target, Range("SLA!A:Z")) Is Nothing Then
Dim objHTTP As Object
Dim URL As String, Json As String, ColLett As String, CellValue As String, SheetName As String
Dim RowNum As Long
ColLett = Split(Cells(1, Target.Column).Address, "$")(1) 'Collumn Letter
RowNum = Target.Row 'Row Number
SheetName = Name 'Sheet Name
CellValue = Target.Value 'Cell Value
Set objHTTP = CreateObject("MSXML2.ServerXMLHTTP")
URL = " [B][URL][/B] ?SheetName=" & SheetName & "&Column=" & ColLett & "&RowNumber=" & RowNum & "&CellValue=" & CellValue
objHTTP.Open "PATCH", URL, False
objHTTP.setRequestHeader "Content-type", "application/json"
objHTTP.send (Json) 'Send Information
End If
End Sub
NOTE - in "" [/B]inside the code i'm adding re...ly, but not when cell was changed by formula.