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 October 10th, 2017, 04:58 PM
Authorized User
Join Date: Oct 2015
Posts: 48
Thanks: 0
Thanked 5 Times in 5 Posts
Default Macro

Sub Macro1()
Dim WB As Workbook
Dim WS As Worksheet
Dim myCell As Integer
Dim myWhite As Integer, myGrey As Integer

Set WB = Application.ThisWorkbook
Set WS = WB.ActiveSheet
myWhite = -4142 ' None Colored
myGrey = 16     ' A shade of grey

'Debug.Print WS.Cells(9, 3).Interior.ColorIndex

For i = 2 To 12
    myCell = WS.Cells(i, 3).Interior.ColorIndex
    If myCell <> myWhite Then
        WS.Cells(i, 1).Interior.ColorIndex = myGrey
        Debug.Print WS.Cells(i, 3).Interior.ColorIndex
    End If
End Sub
Nostalgia 4 Infinity
Old October 11th, 2017, 12:11 PM
Registered User
Join Date: Oct 2017
Posts: 11
Thanks: 1
Thanked 0 Times in 0 Posts

ohhhh I see.... So with the immediate window pulling and temporarily storing data, can you call on the data in the immediate window too?

Similar Threads
Thread Thread Starter Forum Replies Last Post
How to get Excel Cell color populate .NET Framework 2.0 2 March 3rd, 2014 04:25 AM
need help with fill in cell color pooky Excel VBA 1 July 29th, 2012 09:58 PM
change cell color martin1 Visual Basic 2005 Basics 2 October 4th, 2006 08:55 AM
Change Cell Color phungleon HTML Code Clinic 2 April 9th, 2006 12:36 AM
Listview Cell Color leontun Pro VB 6 2 December 15th, 2004 04:14 PM

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