Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Insert Blank Line after the Word Category is found
I need to be able to insert a blank line each time the word Category is found
in Column B. How would I write this code Thanks |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Insert Blank Line after the Word Category is found
Sub InsertRow()
Dim oCell As Range Columns("B:B").Select For Each oCell In Selection If oCell.FormulaR1C1 = "Category" Then oCell.Select ActiveCell.Offset(1, 0).Select Selection.EntireRow.Insert End If Next End Sub "Nigel" wrote: I need to be able to insert a blank line each time the word Category is found in Column B. How would I write this code Thanks |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Insert Blank Line after the Word Category is found
Sub InsertRow()
With Worksheets("Sheet1") lastrow = Worksheets("Sheet1").Cells(Rows.Count, "B").End(xlUp).Row For r = 1 To lastrow If UCase(.Cells(r, "B")) = "CATEGORY" Then .Cells(r, "B").Offset(1, 0).EntireRow.Insert End If Next r End With End Sub "Jim F" wrote: Sub InsertRow() Dim oCell As Range Columns("B:B").Select For Each oCell In Selection If oCell.FormulaR1C1 = "Category" Then oCell.Select ActiveCell.Offset(1, 0).Select Selection.EntireRow.Insert End If Next End Sub "Nigel" wrote: I need to be able to insert a blank line each time the word Category is found in Column B. How would I write this code Thanks |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
How do I insert a blank line when category changes | Excel Discussion (Misc queries) | |||
insert a blank in every second line of a row | Excel Discussion (Misc queries) | |||
Insert Blank Line | Excel Discussion (Misc queries) | |||
auto insert blank line | Excel Discussion (Misc queries) | |||
Add a category to the Insert-Function category list | Excel Programming |