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.

КОМЕНТАРІ • 11

  • @JATINKUMAR-qu4vi
    @JATINKUMAR-qu4vi 2 роки тому +1

    Great teacher

  • @alializadeh8195
    @alializadeh8195 2 роки тому +1

    ممنون

  • @satyasadhannag4004
    @satyasadhannag4004 2 роки тому

    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.

  • @darshanpatel55
    @darshanpatel55 Рік тому

    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.

  • @MohAboAbdo
    @MohAboAbdo 3 роки тому +1

    Thank you so match, Sir.

  • @beenay18
    @beenay18 6 місяців тому

    why colorindex does not work in shapes?

  • @AhmedMohammed-dc6ke
    @AhmedMohammed-dc6ke 2 роки тому

    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..

    • @AhmedMohammed-dc6ke
      @AhmedMohammed-dc6ke 2 роки тому

      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

  • @vividdreamer5025
    @vividdreamer5025 2 роки тому

    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