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

Select a hidden cell
Somehide hide payroll data in column G? Press F5. Type G1. Enter. Look in formula bar while you arrow down through G.
Couldn't you just use Goto>Special and select Blanks?
 
Upvote 0

Forum statistics

Threads
1,222,314
Messages
6,165,297
Members
451,950
Latest member
WH2000

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
Back
Top