S
saman110 via OfficeKB.com
How do you guys put or run two macros together in one macro. I have to
separate macros that i want to run one after each other in one macro.
Sub DeleteColumns()
Dim i As Integer
For i = 256 To 1 Step -1
If Cells(1, i).Text = "Rank" Or _
Cells(1, i).Text = "Housing units" Or _
Cells(1, i).Text = "Occupied Housing Units" Or _
Cells(1, i).Text = "Vacant Housing Units" Then
Cells(1, i).EntireColumn.Delete
End If
Next i
End Sub
----------------------and
Sub DeleteColumns()
Dim i As Integer
For i = 256 To 1 Step -1
If Cells(2, i).Text = "Subtotal of High" Or _
Cells(2, i).Text = "Subtotal of Extremely High" Or _
Cells(2, i).Text = "Subtotal of Average" Or _
Cells(2, i).Text = "Subtotal of Below Average" Or _
Cells(2, i).Text = "Subtotal of Above Average" Or _
Cells(2, i).Text = "Grand Total" Then
Cells(2, i).EntireRow.Delete
End If
Next i
End Sub
separate macros that i want to run one after each other in one macro.
Sub DeleteColumns()
Dim i As Integer
For i = 256 To 1 Step -1
If Cells(1, i).Text = "Rank" Or _
Cells(1, i).Text = "Housing units" Or _
Cells(1, i).Text = "Occupied Housing Units" Or _
Cells(1, i).Text = "Vacant Housing Units" Then
Cells(1, i).EntireColumn.Delete
End If
Next i
End Sub
----------------------and
Sub DeleteColumns()
Dim i As Integer
For i = 256 To 1 Step -1
If Cells(2, i).Text = "Subtotal of High" Or _
Cells(2, i).Text = "Subtotal of Extremely High" Or _
Cells(2, i).Text = "Subtotal of Average" Or _
Cells(2, i).Text = "Subtotal of Below Average" Or _
Cells(2, i).Text = "Subtotal of Above Average" Or _
Cells(2, i).Text = "Grand Total" Then
Cells(2, i).EntireRow.Delete
End If
Next i
End Sub