Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 148
Default Conditional Formatting - Inserting Rows

Hi,

Is there a way that when you insert rows, the conditional formatting on the
adjacent rows does not copy into the inserted/new row?

Thanks,
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 2,836
Default Conditional Formatting - Inserting Rows

Here are tow ways of inserting a row when the text changes in Column A (I
don't know why you are inserting rows).

Sub InsertRow_At_Change()
Dim LastRow As Long
Dim x As Long
LastRow = Cells(Rows.Count, 1).End(xlUp).Row
Application.ScreenUpdating = False

For x = LastRow To 3 Step -1
If Cells(x, 1).Value < Cells(x - 1, 1).Value Then
If Cells(x, 1).Value < "" Then
If Cells(x - 1, 1).Value < "" Then
Cells(x, 1).EntireRow.Insert Shift:=xlDown
End If
End If
End If
Next x

Application.ScreenUpdating = True
End Sub

Sub InsertAfterTextChange()
Do Until ActiveCell = Empty And ActiveCell.Offset(1) = Empty
If ActiveCell < ActiveCell.Offset(1) And ActiveCell < Empty And
ActiveCell.Offset(1) < Empty Then
ActiveCell.Offset(1).EntireRow.Insert
ActiveCell.Offset(2).Select
Else
ActiveCell.Offset(1).Select
End If
Loop
End Sub

--
Ryan---
If this information was helpful, please indicate this by clicking ''Yes''.


"Danny" wrote:

Hi,

Is there a way that when you insert rows, the conditional formatting on the
adjacent rows does not copy into the inserted/new row?

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
Condtional Formatting - Inserting Rows Danny Excel Worksheet Functions 1 December 23rd 09 08:24 PM
Inserting a new column affects conditional formatting tino2009 New Users to Excel 9 June 29th 09 10:18 AM
Conditional formatting rows Louise B. Excel Discussion (Misc queries) 4 January 7th 07 01:51 AM
Conditional Formatting when inserting a row zahoulik Excel Worksheet Functions 2 January 7th 06 03:01 PM
Conditional Formatting Reference / Inserting Rows Werner Rohrmoser Excel Worksheet Functions 1 September 9th 05 02:27 PM


All times are GMT +1. The time now is 10:08 AM.

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"