Skip to main content

How to return background color of cell – Vba Code resolved

Copy & paste below VBA code in your Module & use function “=CellColorIndex(A2)” in sheet.

 

Function CellColorIndex(InRange As Range, Optional OfText As Boolean = False) As Integer
   ‘This Code created by Akumar, www.99excel.com
   Application.Volatile True
   If OfText = True Then
   CellColorIndex = InRange(1, 1).Font.ColorIndex
   Else
   CellColorIndex = InRange(1, 1).Interior.ColorIndex
   End If
End Function

 

 

Buy Excel Books Online , http://99excel.com/books/

http://99excel.com/books/

Buy Excel Books Online

 

 

Excel Books Buy Now 495  

Basic Excel Introduction

Basic Excel – Learn the Excel Basics – Excel Functions and Formulas, An Overview of the Excel Basics that will assist you when using excel. Brief Introduction to Excel. Excel is the spreadsheet program created by Microsoft.


Excel Books Buy Now 512  

Get 100 Ready-to-Use

Read 100 Ready-to-Use Excel Formulas, Vba Examples and timesaving shortcut key. Employing various Excel functions, formulas enable Excel analysts to create aggregated reporting, complex calculation engines, clever dashboard models, and much more.


Excel Books Buy Now 850  

Advanced Excel – Vba Introduction

Learn everything about Excel with this smart book. It covers most of the advanced skills that you need for business. Advanced Excel Essentials is the only book for experienced Excel developers who want to channel their skills into building spreadsheet applications and Automation in Vba.


Excel Books Download Free  

Pivot Tables and Pivot Charts

This booklet is the companion document to the Excel 2013: PivotTables and Pivot Charts workshop. The booklet will explain PivotTables and Pivot Charts, how to create them, and how to use them to quickly analyze large quantities of data.