MelodyCosta
New Member
- Joined
- Apr 26, 2022
- Messages
- 4
- Office Version
- 365
- 2010
- Platform
- Windows
- Mobile
- Web
Hi Everyone:
I am looking for a little bit of help. I have looked through the threads and dont see any thing that answers my question fully. Please see below code:
Object: Once the character limit has been reached, paste remainder text in the cells below one another.
Eg: I have copied text that has 80,000 characters in it: Cell A1 - paste 32,767 characters -> then
spill over remainder characters to Cell A2 - paste 32,767 characters -> then
spill over remainder characters to Cell A2 - paste 14,466 characters -> Finished
' Fetch Entire Source Code
Private Sub HTML_VBA_Excel()
Dim oXMLHTTP As Object
Dim sPageHTML As String
Dim sURL As String
'Change the URL before executing the code
sURL = Google
'Extract data from website to Excel using VBA
Set oXMLHTTP = CreateObject("MSXML2.ServerXMLHTTP")
oXMLHTTP.Open "GET", sURL, False
oXMLHTTP.send
sPageHTML = oXMLHTTP.responseText
' Get webpage data into Excel
' If longer source code mean, you need to save to a external text file or somewhere,
' since excel cell have some limits on storing max characters
' I would like to split the HTML code before it gets pasted to the excel file, to work around the character limits within an excel “Cell”.
ThisWorkbook.Sheets(1).Cells(1, 1) = sPageHTML
MsgBox "XMLHTML Fetch Completed"
End Sub
I am looking for a little bit of help. I have looked through the threads and dont see any thing that answers my question fully. Please see below code:
Object: Once the character limit has been reached, paste remainder text in the cells below one another.
Eg: I have copied text that has 80,000 characters in it: Cell A1 - paste 32,767 characters -> then
spill over remainder characters to Cell A2 - paste 32,767 characters -> then
spill over remainder characters to Cell A2 - paste 14,466 characters -> Finished
' Fetch Entire Source Code
Private Sub HTML_VBA_Excel()
Dim oXMLHTTP As Object
Dim sPageHTML As String
Dim sURL As String
'Change the URL before executing the code
sURL = Google
'Extract data from website to Excel using VBA
Set oXMLHTTP = CreateObject("MSXML2.ServerXMLHTTP")
oXMLHTTP.Open "GET", sURL, False
oXMLHTTP.send
sPageHTML = oXMLHTTP.responseText
' Get webpage data into Excel
' If longer source code mean, you need to save to a external text file or somewhere,
' since excel cell have some limits on storing max characters
' I would like to split the HTML code before it gets pasted to the excel file, to work around the character limits within an excel “Cell”.
ThisWorkbook.Sheets(1).Cells(1, 1) = sPageHTML
MsgBox "XMLHTML Fetch Completed"
End Sub