"Conditional" formatting by Cell selected

M

marko

Hi,

I'll try to explain my problem. In column A i can have 5 different
numbers: 1,2,3,4 and 5. So the value of any cell in column A (except
for rows 1,2,3,4,5 - they are heading rows ) can be 1 to 5.
Row 1,2,3,4 and 5 are heading rows.
This is what i would like: when I'm in some row (for example row 34 -
and the value of cell A34 is for example 3), and certain column(lets
say column H), I would like cell H3 to become let's say bold(or change
background color or both) - H3 because when the value in cell A34 is 3
that means that heading row 3 is used and needs to be bolded (but now
the whole row just the cell above my selected cell but in the
appropriate heading row - so if A34 is 1 cell H1 will be bolded and so
on).
I have some knowledge of VB so if I need to use VB here I think i
could manage.
If you have any sugestions it would mean a lot to me!
If you don't understand :) my problem plese say and I'll try to
explain again :)

Cheers,

Marko ©vaco
 
O

OssieMac

Hi Marko,

I am really not sure if I fully understand what you want to do. The
following code sample might to point you in the right direction to achieve
your desired result.

I suggest that you test in a blank workbook.

Enter the number 3 into cell A10 on the worksheet.

Double click on the worksheet name tab and select View Code. The VBA editor
will open in the worksheet name area that you double clicked.

Copy the following macro into the VBA editor and it will run each time you
change the selection on the worksheet. However, it will only do something if
you click in cell A10 and if the value of cell A10 is 3.

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Target.Address = "$A$10" Then
If Target.Value = 3 Then
Rows(3).Interior.ColorIndex = 6
End If
End If

End Sub

Regards,

OssieMac
 

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

Top