change line colors on multiple sheets.

F

Farooq Sheri

Is it possible to change line color by clicking on the it i.e. if I click on
a line its color should change to, say, red. Furthermore, is it possible to
click a line on one sheet and have some other line on another sheet to be
selected (as part of a group).

Thanks.
 
P

Per Jessen

Hi

Paste this event code into the codesheet for the desired sheet. This will
change row color for the selected cell to red in the desired sheet and in
sheet3.

Dim PreviousRow As Integer
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If PreviousRow <> 0 Then
Rows(PreviousRow).Interior.ColorIndex = xlNone
Sheets("Sheet3").Rows(PreviousRow).Interior.ColorIndex = xlNone
End If
PreviousRow = Target.Row
Target.EntireRow.Interior.ColorIndex = 3
Sheets("Sheet3").Rows(Target.Row).Interior.ColorIndex = 3
End Sub

Hopes this helps
 
F

Farooq Sheri

Hi Jessen

I want to change color of line / select another line (drawn by using the
drawign tool). Your answer is about a cell. Can this be done for a line?
 
J

Jacob Skaria

Dear Farooq

You can assign a macro and use the below code.

Set oShp = ActiveSheet.Shapes(1)
oShp.Line.ForeColor.SchemeColor = 2

If this post helps click Yes
 

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