need help formatting blank rows between sections of a doc

jmckeone

Well-known Member
Joined
Jun 3, 2006
Messages
550
What I'd like to do is begin at the top of the page and stop at each blank row and then delete any conditional formats which exist and then re-format as follows:

Code:
Sub BlankRowFormats()

' BlankRowFormats Macro
' Macro recorded 7/25/2007 by E012884

    Range("A2").Select
    Range("A2:Y2").Select
    Selection.FormatConditions.Delete
    Selection.Interior.ColorIndex = 40
    Selection.Font.ColorIndex = 0
    Selection.Font.Bold = True

    Range("A2:K2").Select
    Range("K2").Activate
    With Selection
        .HorizontalAlignment = xlLeft
    End With
    
    Range("L2:Y2").Select
    With Selection
        .HorizontalAlignment = xlRight
    End With
    
    Range("A2").Select
    ActiveCell.FormulaR1C1 = "=R[1]C"

End Sub

Here's what it looks like to begin with. The other trick being how to tell it to stop when it gets to the bottom of the available data.

url]
 

Excel Facts

Best way to learn Power Query?
Read M is for (Data) Monkey book by Ken Puls and Miguel Escobar. It is the complete guide to Power Query.

Norie

Well-known Member
Joined
Apr 28, 2004
Messages
76,357
Office Version
  1. 365
Platform
  1. Windows
Couldn't you just use Goto>Special and select Blanks?
 

Forum statistics

Threads
1,181,728
Messages
5,931,696
Members
436,798
Latest member
spprtpplcm

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Top