Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 141
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 26
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4,339
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
How do I insert a blank line when category changes castleds Excel Discussion (Misc queries) 2 September 27th 06 09:10 PM
insert a blank in every second line of a row EliseT Excel Discussion (Misc queries) 6 June 5th 06 01:43 PM
Insert Blank Line Sherry Excel Discussion (Misc queries) 8 January 31st 06 03:37 PM
auto insert blank line Little pete Excel Discussion (Misc queries) 4 August 29th 05 09:48 PM
Add a category to the Insert-Function category list Tony Seiscons Excel Programming 1 September 22nd 04 02:41 PM


All times are GMT +1. The time now is 09:06 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"