-
Solved: format row with random selection
Hi All, have not been here for awhile. But need to be able to select a random row and apply specific formatting. (Attached spreadsheet example below) Right now I have it set up to Click "Add section" and it add a row and then formats the row. But I really need to be able to select any random row and then click "Add section" and it would format the selected row. Any help for me on this one out there. Thanks in advance.
-
Maybe something like this
[VBA]
Option Explicit
Sub Add_Sec()
If Not TypeOf Selection Is Range Then Exit Sub
With Selection.Rows(1).EntireRow
.Cells(1).Value = "Section"
With .Cells(1).Resize(1, 3).Interior
.ColorIndex = 8
.Pattern = xlSolid
End With
With .Cells(4).Resize(1, 7).Interior
.ColorIndex = 48
.Pattern = xlSolid
End With
End With
End Sub
[/VBA]
Paul
-
Perfect, you guys are so cool. thanks a mil.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules