Solved

Set Interior.ColorIndex

Posted on 2012-03-30
3
227 Views
Last Modified: 2012-03-30
Hello Experts,

I need to set my Interior.Color.Index to 15 for every other cell in my range starting with A5, after I set my sheet to merge cells.

So far I have my code as:

Private Sub MergeBlockNames()
   
    For i = 5 To 74 Step 2
    Range(Cells(i, 1), Cells(i + 1, 1)).Merge
    Next i

End Sub

I am confused how to add this next step - can you please help?
Thanks
0
Comment
Question by:mike637
  • 2
3 Comments
 
LVL 12

Accepted Solution

by:
kgerb earned 500 total points
Comment Utility
You're question in a little unclear.  Is this what you're looking for?  If not we'll need some more explanation.
Private Sub MergeBlockNames()
Dim i As Long, j As Long
j = 1
For i = 5 To 74 Step 2
    j = j + 1
    With Range(Cells(i, 1), Cells(i + 1, 1))
        .Merge
        If j Mod 2 = 0 Then .Interior.ColorIndex = 15
    End With
Next i
End Sub

Open in new window

Kyle
0
 

Author Closing Comment

by:mike637
Comment Utility
That was it!!

Thank you very much Kyle!
0
 
LVL 12

Expert Comment

by:kgerb
Comment Utility
You're welcome.  Glad to help.
Kyle
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Suggested Solutions

Dealing with unintended Excel Active-X resizing quirks (VBA code simulates "self correction") David Miller (dlmille) Intro Not everyone is a fan of Active-X controls in spreadsheets (as opposed to the UserForm approach, the older Form controls …
Introduction This Article is a follow-up to my Mappit! Addin Article (http://www.experts-exchange.com/A_2613.html), it was inspired by an email posting I made to EUSPRIG (http://www.eusprig.org/index.htm), I will briefly cover: 1) An overvie…
The viewer will learn how to simulate a series of sales calls dependent on a single skill level and learn how to simulate a series of sales calls dependent on two skill levels. Simulating Independent Sales Calls: Enter .75 into cell C2 – “skill leve…
This Micro Tutorial demonstrates in Microsoft Excel how to consolidate your marketing data by creating an interactive charts using form controls. This creates cool drop-downs for viewers of your chart to choose from.

728 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now