Excel: Get cell color

前端 未结 3 1148
野的像风
野的像风 2021-01-06 03:30

1) How do I get the color of a cell using an Excel Macro? I couldn\'t get this function work:

Sub BGCol(MRow As Integer, MCol As Integer)  
bgColor = Cells(M         


        
3条回答
  •  暗喜
    暗喜 (楼主)
    2021-01-06 04:17

    Function GetColor(Mycell As Range)
    
        GetColor = Mycell.Interior.ColorIndex
    
    End Function
    

    :::Use Formula:: =getcolor(x4)

提交回复
热议问题