Skip to content

Instantly share code, notes, and snippets.

Sub ScrapeCarDataPt4()
Dim IE As InternetExplorer
Set IE = CreateObject("InternetExplorer.Application")
IE.Visible = True
IE.Navigate "https://carousell.com/categories/cars-32/cars-for-sale-1173/"
Do While IE.ReadyState <> READYSTATE_COMPLETE: Loop
Dim CarListings As IHTMLElementCollection
Sub ScrapeCarDataPt3()
Dim IE As InternetExplorer
Set IE = CreateObject("InternetExplorer.Application")
IE.Visible = True
IE.Navigate "https://carousell.com/categories/cars-32/cars-for-sale-1173/"
Do While IE.ReadyState <> READYSTATE_COMPLETE: Loop
Dim CarListings As IHTMLElementCollection
Sub ScrapeCarDataPt2()
Dim IE As InternetExplorer
Set IE = CreateObject("InternetExplorer.Application")
IE.Visible = True
IE.Navigate "https://carousell.com/categories/cars-32/cars-for-sale-1173/"
Do While IE.ReadyState <> READYSTATE_COMPLETE: Loop
Dim CarListings As IHTMLElementCollection
Sub ScrapeCarDataPt1()
Dim IE As InternetExplorer
Set IE = CreateObject("InternetExplorer.Application")
IE.Visible = True
IE.Navigate "https://carousell.com/categories/cars-32/cars-for-sale-1173/"
Do While IE.ReadyState <> READYSTATE_COMPLETE: Loop
Dim CarListings As IHTMLElementCollection
<html>
<head>
<title>Page Title</title>
</head>
<body>
<h1>My First Heading</h1>
<p>My first paragraph.</p>
</body>
Sub BrowseToSite()
Dim IE As InternetExplorer
Set IE = CreateObject("InternetExplorer.Application")
IE.Visible = True
IE.Navigate "http://www.google.com"
'Waiting for Internet Explorer to load Fully
Do While IE.ReadyState <> READYSTATE_COMPLETE
Loop
Sub VBAStringManipulation()
Dim Str1 As String
Str1 = "TomCruise@gmail.com"
Debug.Print InStr(1, Str1, "i")
Debug.Print InStrRev(Str1, "i")
Debug.Print Mid(Str1, 17, 3)
Debug.Print StrReverse(Str1)
Debug.Print Len(Str1)
End Sub
Sub Sheet2RowValues()
Dim wb As Workbook
Dim ws2 As Worksheet
Set wb = ThisWorkbook
Set ws2 = wb.Sheets("Sheet2")
lastRow = ws2.Cells(Rows.Count, 1).End(xlUp).Row
For i = 1 To lastRow
Sub AllRowValues()
lastRow = Cells(Rows.Count, 1).End(xlUp).Row
For i = 1 To lastRow
Debug.Print Cells(i, 1).Value
Next i
End Sub
Sub ForLoop()
For i = 1 To 10
debug.print i
Next i
End Sub