Prachijain
New Member
- Joined
- May 8, 2018
- Messages
- 12
Hi,
I'm struggling to convert the date into ISO format which is giving me wrong results while I compare two different sheet.
My inputs are
[TABLE="width: 3770"]
<tbody>[TR]
[TD="class: xl63, width: 110, align: right"]4/9/1984[/TD]
[TD="class: xl63, width: 106, align: right"]8/1/2007[/TD]
[TD="class: xl64, width: 97"]F[/TD]
[TD="class: xl64, width: 162, align: right"]21006.87[/TD]
[TD="class: xl64, width: 151"]Regular School District[/TD]
[TD="class: xl64, width: 166, align: right"]1[/TD]
[TD="class: xl64, width: 179"]Average[/TD]
[TD="class: xl64, width: 199, align: right"]34[/TD]
[TD="class: xl64, width: 206, align: right"]54[/TD]
[TD="class: xl64, width: 87, align: right"]57[/TD]
[TD="class: xl64, width: 158, align: right"]57[/TD]
[TD="class: xl64, width: 165, align: right"]57[/TD]
[TD="class: xl64, width: 177, align: right"]1[/TD]
[TD="class: xl64, width: 182, align: right"]4[/TD]
[TD="class: xl64, width: 194, align: right"]33.4[/TD]
[TD="class: xl64, width: 214, align: right"]18245.93[/TD]
[TD="class: xl64, width: 214, align: right"]259616.66[/TD]
[TD="class: xl66, width: 158"]18747.37[/TD]
[TD="class: xl63, width: 107, align: right"]1/1/2018[/TD]
[TD="class: xl64, width: 140, align: right"]22508.86[/TD]
[TD="class: xl64, width: 137, align: right"]0[/TD]
[TD="class: xl63, width: 104, align: right"]1/1/1900[/TD]
[TD="class: xl64, width: 199, align: right"]52075.99[/TD]
[TD="class: xl65, width: 158, align: right"]18747.37[/TD]
[/TR]
</tbody>[/TABLE]
In my inputs the four cells consists of date where they need to pass the web service call in ISO format. As my api as a ISO format date.
This is the VBA code. Any help is greatly appreciated . Please help
I'm struggling to convert the date into ISO format which is giving me wrong results while I compare two different sheet.
My inputs are
[TABLE="width: 3770"]
<tbody>[TR]
[TD="class: xl63, width: 110, align: right"]4/9/1984[/TD]
[TD="class: xl63, width: 106, align: right"]8/1/2007[/TD]
[TD="class: xl64, width: 97"]F[/TD]
[TD="class: xl64, width: 162, align: right"]21006.87[/TD]
[TD="class: xl64, width: 151"]Regular School District[/TD]
[TD="class: xl64, width: 166, align: right"]1[/TD]
[TD="class: xl64, width: 179"]Average[/TD]
[TD="class: xl64, width: 199, align: right"]34[/TD]
[TD="class: xl64, width: 206, align: right"]54[/TD]
[TD="class: xl64, width: 87, align: right"]57[/TD]
[TD="class: xl64, width: 158, align: right"]57[/TD]
[TD="class: xl64, width: 165, align: right"]57[/TD]
[TD="class: xl64, width: 177, align: right"]1[/TD]
[TD="class: xl64, width: 182, align: right"]4[/TD]
[TD="class: xl64, width: 194, align: right"]33.4[/TD]
[TD="class: xl64, width: 214, align: right"]18245.93[/TD]
[TD="class: xl64, width: 214, align: right"]259616.66[/TD]
[TD="class: xl66, width: 158"]18747.37[/TD]
[TD="class: xl63, width: 107, align: right"]1/1/2018[/TD]
[TD="class: xl64, width: 140, align: right"]22508.86[/TD]
[TD="class: xl64, width: 137, align: right"]0[/TD]
[TD="class: xl63, width: 104, align: right"]1/1/1900[/TD]
[TD="class: xl64, width: 199, align: right"]52075.99[/TD]
[TD="class: xl65, width: 158, align: right"]18747.37[/TD]
[/TR]
</tbody>[/TABLE]
In my inputs the four cells consists of date where they need to pass the web service call in ISO format. As my api as a ISO format date.
Code:
Public Sub exceljson2(input1, rowloop)Dim http As Object, JSON As Object, arr As String
Set http = CreateObject("MSXML2.XMLHTTP")
http.Open "POST", "https://bitlb02.poolt.hewitt.com/dsi0042/calculator", False
http.setRequestHeader "Content-type", "application/x-www-form-urlencoded"
http.send input1
'MsgBox (http.responseText)
arr = http.responseText
arr = Replace(arr, "{", "")
arr = Replace(arr, "}", "")
Dim LArray() As String
Dim RArray() As String
LArray() = Split(arr, ",")
ub = UBound(LArray())
Dim myString As String
For a = 0 To ub
RArray() = Split(LArray(a), ":")
myString = myString + RArray(0) + ": " + RArray(1) + ","
DQ = Chr(34)
Worksheets("Sheet1").Cells(1, a + 1).Value = Replace(RArray(0), DQ, "") ' title row
Worksheets("Sheet1").Cells(rowloop, a + 1).Value = Replace(RArray(1), DQ, "")
Next a
End Sub
This is the VBA code. Any help is greatly appreciated . Please help