TenDollarTypo
New Member
- Joined
- Dec 9, 2022
- Messages
- 1
- Office Version
- 365
- Platform
- Windows
Sub SelectEvery9Rows()
Dim MyRange As Range
Dim RowSelect As Range
Dim i As Integer
Set MyRange = Selection
Set RowSelect = MyRange.Rows(9)
For i = 9 To MyRange.Rows.Count Step 9
Set RowSelect = Union(RowSelect, MyRange.Rows(i))
Next i
Application.Goto RowSelect
With Selection
.HorizontalAlignment = xlCenter
.VerticalAlignment = xlBottom
.WrapText = False
.Orientation = 0
.AddIndent = False
.IndentLevel 0
.ShrinkTorit = False
.ReadingOrder = xlContext
.MErgeCells = False
End With
Selection.Merge
End Sub
Keep getting an error is there something wrong with the code?
Dim MyRange As Range
Dim RowSelect As Range
Dim i As Integer
Set MyRange = Selection
Set RowSelect = MyRange.Rows(9)
For i = 9 To MyRange.Rows.Count Step 9
Set RowSelect = Union(RowSelect, MyRange.Rows(i))
Next i
Application.Goto RowSelect
With Selection
.HorizontalAlignment = xlCenter
.VerticalAlignment = xlBottom
.WrapText = False
.Orientation = 0
.AddIndent = False
.IndentLevel 0
.ShrinkTorit = False
.ReadingOrder = xlContext
.MErgeCells = False
End With
Selection.Merge
End Sub
Keep getting an error is there something wrong with the code?