Sharid
Well-known Member
- Joined
- Apr 22, 2007
- Messages
- 1,064
- Office Version
- 2016
- Platform
- Windows
I am trying to write this line of code so it takes the sheet to use from a Sheet + cell in excel I can do it with the class and child nods, but not for the sheet to input the data. The code is repeated for columns A to K
I know that even this is not the best, however I am limited in VBA and it does work
I tried this, however the data is not correct see image below, with the above code it extracts correctly, for 200+ records.
I know that even this is not the best, however I am limited in VBA and it does work
VBA Code:
If element.getElementsByClassName(Sheets("Sheet20").Range("A23"))(Sheets("Sheet20").Range("B23")) Is Nothing Then ' Get CLASS and Child Nod
wsSheet.Cells(Sheet3.Cells(Sheet3.Rows.Count, "F").End(xlUp).row + 1, "F").Value = "-" 'If Nothing then Hyphen
Else
HtmlText = element.getElementsByClassName(Sheets("Sheet20").Range("A23"))(Sheets("Sheet20").Range("B23")).innerText ' Get CLASS and Child Nod
wsSheet.Cells(Sheet3.Cells(Sheet3.Rows.Count, "F").End(xlUp).row + 1, "F").Value = HtmlText 'return value in column
End If
I tried this, however the data is not correct see image below, with the above code it extracts correctly, for 200+ records.
VBA Code:
If element.getElementsByClassName(Sheets("Sheet20").Range("A23"))(Sheets("Sheet20").Range("B23")) Is Nothing Then ' Get CLASS and Child Nod
'''#### Instead of Sheet3 I am trying to get the required sheet from SHEET20 Cell E16
wsSheet.Cells(Sheets("Sheet20").Range("E16").Cells(Sheets("Sheet20").Range("E16").Rows.Count, "F").End(xlUp).row + 1, "F").Value = "-" 'If Nothing then Hyphen
Else
HtmlText = element.getElementsByClassName(Sheets("Sheet20").Range("A23"))(Sheets("Sheet20").Range("B23")).innerText ' Get CLASS and Child Nod
'''#### Instead of Sheet3 I am trying to get the required sheet from SHEET20 Cell E16
wsSheet.Cells(Sheets("Sheet20").Range("E16").Cells(Sheets("Sheet20").Range("E16").Rows.Count, "F").End(xlUp).row + 1, "F").Value = HtmlText 'return value in column
End If