VBA Need cell color in font color

sksanjeev786

Well-known Member
Joined
Aug 5, 2020
Messages
884
Office Version
  1. 365
  2. 2016
Platform
  1. Windows
Hi Team,

I need the cell color on the data........

Book1
ABCDEFG
2Unaided Brand Awareness 8%9%0%9%7%-2%
3Aided Brand Awareness 94%95%1%91%97%6%
4Message Association18%19%1%17%22%5%
5Consideration Intent 45%57%12%41%69%28%
6Aided Brand Awareness 85%88%3%86%88%2%
7Total Ad Recall47%56%9%42%71%29%
8Digital Ad Recall 21%23%2%22%49%27%
Sheet1
 
Try this version:

VBA Code:
Sub SomethinForSanjeev_3D()
'Crafted by Wookiee at MrExcel.com


Dim rngCell As Range

For Each rngCell In Selection

  With rngCell

    Select Case rngCell.Interior.Color

      Case Is = RGB(204, 51, 51), RGB(150, 193, 29), RGB(191, 191, 191)
     
        .Font.Color = .Interior.Color
        .Interior.Pattern = xlNone

      Case RGB(255, 150, 0)
     
        .Font.Color = RGB(0, 122, 192)
        .Interior.Pattern = xlNone

    End Select

  End With

Next rngCell

End Sub
Wow!!!!!

Thank you so much for your hard work on this..:):)

Super Happy!!!!!!
 
Upvote 0

Forum statistics

Threads
1,216,165
Messages
6,129,235
Members
449,496
Latest member
Patupaiarehe

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top