Sharid
Well-known Member
- Joined
- Apr 22, 2007
- Messages
- 1,066
- Office Version
- 2016
- Platform
- Windows
How can I write this, as currently it is giving me just the word "None" even if there is data. In short if there is innertext to extract, extract it if there is nothing then place "None" in the cell
VBA Code:
If dd = doc.getElementsByClassName("_50f4")(2) Is Nothing Then
wsSheet.Cells(Sheet1.Cells(Sheet1.Rows.Count, "B").End(xlUp).Row + 1, "B").Value = "None"
Else
dd = doc.getElementsByClassName("_50f4")(2).innerText
Sheet1.Cells(Sheet1.Cells(Sheet1.Rows.Count, "B").End(xlUp).Row + 1, "B").Value = dd
End If