PDA

View Full Version : [SOLVED:] Split the selected Table by every single Row by VBA



kamkwok6
03-14-2022, 11:04 PM
How to split the selected Table by every single Row by VBA. Many Thanks!


Original
2950529506




Final outcome as below
2950729508

gmayor
03-14-2022, 11:14 PM
That's simple enough

Sub Split()
Dim oTable As Table
Dim lRow As Long
Set oTable = Selection.Tables(1)
For lRow = oTable.Rows.Count To 1 Step -1
oTable.Rows(lRow).Select
Selection.SplitTable
Next lRow
Set oTable = Nothing
End Sub