Class Module values to Worksheet

stapuff

Well-known Member
Joined
Feb 19, 2004
Messages
1,126
From the code below I am looking to return the values from

m_xmlHttp.responseText to a worksheet range.

Preferable 1 cell per line.

So as an example - if this is ran it returns 40 lines of data so I would like A1:A40 filled with the data.

Any suggestions would be greatly appreciated.

Kurt


Option Explicit

Dim m_xmlHttp As MSXML2.XMLHTTP

Public Sub Initialize(ByRef xmlHttpRequest As MSXML2.XMLHTTP)
Set m_xmlHttp = xmlHttpRequest
End Sub

Sub OnReadyStateChange()
Debug.Print m_xmlHttp.ReadyState
If m_xmlHttp.ReadyState = 4 Then
If m_xmlHttp.Status = 200 Then
MsgBox m_xmlHttp.responseText
Else
'Error happened
End If
End If
End Sub
 
Kurt

So basically kind o what I suggested, but using the correct reference.:)
 
Upvote 0

Excel Facts

Format cells as time
Select range and press Ctrl+Shift+2 to format cells as time. (Shift 2 is the @ sign).
Norie -

Basically you are correct. I did not realize you could put the worksheet ref like you suggested in the class.

Thanks for your help and your time.

Kurt
 
Upvote 0

Forum statistics

Threads
1,225,155
Messages
6,183,212
Members
453,151
Latest member
Lizamaison

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top