VBA to Get Color of Cell - Cell Background Color in Excel using ColorIndex
Вставка
- Опубліковано 8 жов 2024
- This Excel VBA Example explains VBA ColorIndex to Find Interior Color of Excel Cell. Macro to check background color, return background color and apply background color using ColorIndex in Excel.
Great teacher
ممنون
Sir, you are great! However, my query is where will be available the details of colorindex interior in details. Please reply. Suppose , I want to transfer data from one sheet to another sheet after setting colour index in which the colur will also be transferred with data.
I have new question this day.
If my cell color changes then I want to increase the number from the given value or the cell reference.
I guess you will help me.
Thank you so match, Sir.
Always welcome
welcome
why colorindex does not work in shapes?
Private Sub Color()
Dim mycell As Range
Dim myrange As Range
Set myrange = Worksheets("Sheet2").Range("C1:C20000")
For Each mycell In myrange
mycell.Value = mycell.Interior.ColorIndex
Next mycell
End Sub
it is taking color coding on same colored cell...I want the color coding in different cell..
Got it
Private Sub Color()
Dim mycell As Range
Dim myrange As Range
Set myrange = Worksheets("Sheet2").Range("C1:C20000")
Set mycell = Worksheets("Sheet2").Range("A1:A20000")
For Each mycell In mycell
mycell.Value = mycell.Interior.ColorIndex
Next mycell
End Sub
Hi ,
Sub GoTo_Example1()
Application.Goto Reference:=Worksheets("Jan").Range("C5"),Scroll:=True
End Sub
This is VBA code which i use to go to a cell , but i want to use this code in VBA code for a automation tool , where the range value varies for every sheet. So for that , i have a range value in a cell , which i want to go, so can u please help me out , how the Above code should be used to take the range from a cell (which has range value, which changes from sheet to sheet). Thanks