Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Microsoft Office > Excel VBA > Excel VBA
|
Excel VBA Discuss using VBA for Excel programming.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Excel VBA section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old April 22nd, 2005, 08:24 AM
Friend of Wrox
 
Join Date: Jan 2005
Posts: 1,525
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via ICQ to crmpicco Send a message via AIM to crmpicco Send a message via MSN to crmpicco Send a message via Yahoo to crmpicco
Default Interior.ColorIndex problem

In my worksheet i have a cell 'C43' which is coloured 'green'. this is done automatically via my code:

Code:
For j = LBound(gaRulesSearch) To UBound(gaRulesSearch)

            If gaRulesColour(j) <> "" Then
                iPos = InStr(gaRulesColour(j), "/")
                sRange = Left(gaRulesColour(j), InStr(gaRulesColour(j), "/") - 1)
                iColour = Mid(gaRulesColour(j), iPos + 1, Len(gaRulesColour(j)) - 1)

                '... if the value has been found then colour the cell
                '... otherwise write to the log
                If stripWhiteSpace(Left(Trim(UCase(Range(sRange).Text)), Len(Trim(UCase(gaRulesSearch(j)))))) <> stripWhiteSpace(Trim(UCase(gaRulesSearch(j)))) Then
                    Call WriteColourLog(Application.ActiveSheet.Name, "RULES STRING: " & _
                                                                      Chr(34) & UCase(gaRulesSearch(j)) & Chr(34), sRange)
                Else
                    gbFoundRules = True
                    Range(sRange).Interior.ColorIndex = iColour
                End If

            End If


        Next ' for j
Can anyone tell me how I can take that cell as a reference or marker and then proceed to colour each cell directly beneath it if they are not blank (empty)?

I also need to have the cells directly to the LEFT of these cells coloured above to be highlghted a different colour.

Is this possible? if so, anyone got code?

Im really new to VBA so help is greatly appreciated.

Regards

Picco



www.crmpicco.co.uk
www.crmpicco.co.uk.tt
www.milklemonadechocolate.uk.tt
www.griswolds.uk.tt
www.piccosmini.co.uk.tt
www.morton.uk.tt
__________________
_______________________
Ayrshire Minis - a Mini E-Community
http://www.ayrshireminis.com
http://www.crmpicco.co.uk









Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.