Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Excel / New Users / October 2007

Tip: Looking for answers? Try searching our database.

"Conditional" formatting by Cell selected

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
marko - 23 Oct 2007 14:46 GMT
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
OssieMac - 24 Oct 2007 06:13 GMT
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
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.