Hi
I am new member of you house
I came here cuz I have a serious problem.
I want that When I link any cell with another cell of sheet then It should Turn Yellow
Please Help me.
Early responce will be highly appreciated.
Hi
I am new member of you house
I came here cuz I have a serious problem.
I want that When I link any cell with another cell of sheet then It should Turn Yellow
Please Help me.
Early responce will be highly appreciated.
Try pasting the following onto the appropriate tab (e.g. Sheet1) in the VBA editor.
Remember to save in xlsm format.![]()
Private Sub Worksheet_Change(ByVal Target As Range) Cells.Precedents.Interior.ColorIndex = 6 Cells.Dependents.Interior.ColorIndex = 6 End Sub
Martin
Sorry - didn't notice which version you had.
Hit Alt F11 to get to the VA editor - the project navigator is in the top left.
In 2003, save as a .xls
Again Thanks.
@
I have open Alt + F11. Now Tell me where I have to Paste code ?
Sorry still confuse that where I have to Paste it this CODE ?
![]()
Private Sub Worksheet_Change(ByVal Target As Range) Cells.Precedents.Interior.ColorIndex = 6 Cells.Dependents.Interior.ColorIndex = 6 End Sub
Onto the Sheet1 tab - assuming that your cells of interest are on the first sheet.
Double click on Sheet1 in the top left had corner to open the sheet to paste into.
I have done. But It is not Working as my wish.
I have Attached Excel Sheet. Please Check it.When Link then Color change.xlsx
In Excel File there is Two Working Sheet.
1st Sheet name is Link Sheet
2nd Sheet name is Sheet2
In Sheet2 there are Sale datewise
I go to Link Sheet & make Link for D4 with Sheet2 D4
Now I want that After I Linked then Sheet2 D4 cell should automatically turn color
I hope that you have understand my Question very well.
Now Waiting yours Answer Immediently
Try pastng this into the Link Sheet tab in the VBA editor
![]()
Private Sub Worksheet_Change(ByVal Target As Range) Dim Cell As Range For Each Cell In Cells.SpecialCells(xlCellTypeFormulas, 23) Sheets(Mid(Cell.Formula, 2, InStr(Cell.Formula, "!") - 2)).Range(Mid(Cell.Formula, InStr(Cell.Formula, "!") + 1)).Interior.ColorIndex = 6 Next Cell End Sub
OK - try replacig the previous code with this
![]()
Dim PreviousValue As String Private Sub Worksheet_Change(ByVal Target As Range) Dim Cell As Range If InStr(PreviousValue, "!") > 0 Then Sheets(Mid(PreviousValue, 2, InStr(PreviousValue, "!") - 2)).Range(Mid(PreviousValue, InStr(PreviousValue, "!") + 1)).Interior.ColorIndex = -4142 End If On Error GoTo NoFormulae For Each Cell In Cells.SpecialCells(xlCellTypeFormulas, 23) Sheets(Mid(Cell.Formula, 2, InStr(Cell.Formula, "!") - 2)).Range(Mid(Cell.Formula, InStr(Cell.Formula, "!") + 1)).Interior.ColorIndex = 6 Next Cell Exit Sub NoFormulae: Exit Sub End Sub
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks