Results 1 to 1 of 1
2001-04-12, 19:53 #1
- Join Date
- Feb 2001
- Yilgarn region of Toronto, Ontario
- Thanked 0 Times in 0 Posts
Code: Sub udfSplitRowsFromTable()
Here's a crude macro that lets me split one or more rows out of the current table.
Select one or more cells within a table (the macro will take care of row selection) and run the macro.
I'd like to avoid the Selection.SplitTable and replace it with a range.
' Procedure : udfSplitRowsFromTable
' Description: Split the selected rows from within a table
' By: Chris Greaves Inc.
' Inputs: None.
' Returns: None
' Assumes: Nothing
' Side Effects: None.
' Tested: By a call from the user.
If Selection.Information(wdWithInTable) Then
Dim rng As Range
' remember the start and end points of the user's nomination.
Set rng = Selection.Range
' Select the last row of the user's nomination.
' If there is a row beyond it, then we can split.
If (1 + rng.Rows.Count) < rng.Tables(1).Rows.Count Then
rng.Tables(1).Rows(rng.Rows.Count + 1).Select
' Now split the front part.
' provided we are not at the first row of the table.
If rng.Information(wdEndOfRangeRowNumber) = 1 Then
MsgBox "Please select one or more rows of a table."