Background color

K

kirkm

Hi, Can someonr help me with the following?

It's variable mCol. I'm after the background color of the cell
(which isn't .Font.Background).

Thanks - Kirk


Dim x: x = InputBox("Column?") & "2"
Dim rng As Range
Dim MyLastRow, mFont, mSize, mCol
Stop
Set rng = Worksheets("Sheet1").Range(x)

With rng
mFont = .Font.Name
mSize = .Font.Size
mCol = .Font.Background
End With

Stop
 
L

Leith Ross

Hi, Can someonr help me with the following?

It's variable mCol. I'm after the background color of the cell
(which isn't .Font.Background).

Thanks - Kirk

Dim x: x = InputBox("Column?") & "2"
Dim rng As Range
Dim MyLastRow, mFont, mSize, mCol
Stop
Set rng = Worksheets("Sheet1").Range(x)

With rng
mFont = .Font.Name
mSize = .Font.Size
mCol = .Font.Background
End With

Stop

Hi,
Change your variable code to this...

mCol = .Interior.ColorIndex

Sincerely,
Leith Ross
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

active cell issue... 5
Macro Help 1
Workbook/Macro/Worksheet Protection... 2
Assigning range to array not working 2
Help with simple code 2
Excel VBA- 2
User message 5
Counting cells with a specific range 1

Top