vignesh_thegame
New Member
- Joined
- Sep 30, 2013
- Messages
- 48
I need to copy the Table of content from a webpage and paste it to excel with correct indentation.
Now, my current process is, copying the content from webpage and pasting it to an excel and then select the column and run the below script,
This script will placed arrange the content in correct column as per the indention available.
Sub fixdata()
Dim cell As Range
Dim i As Long
For Each cell In Selection
If cell.IndentLevel > 0 Then
cell.Resize(1, cell.IndentLevel).Insert xlShiftToRight
cell.IndentLevel = 0
End If
Next
End Sub
I am looking for some script, which can actually do it from webpage and avoid the copy and paste and executing the script task?
I've attached the screenshot of source TOC and Output excel with correct indentation.
Now, my current process is, copying the content from webpage and pasting it to an excel and then select the column and run the below script,
This script will placed arrange the content in correct column as per the indention available.
Sub fixdata()
Dim cell As Range
Dim i As Long
For Each cell In Selection
If cell.IndentLevel > 0 Then
cell.Resize(1, cell.IndentLevel).Insert xlShiftToRight
cell.IndentLevel = 0
End If
Next
End Sub
I am looking for some script, which can actually do it from webpage and avoid the copy and paste and executing the script task?
I've attached the screenshot of source TOC and Output excel with correct indentation.