Hello
wondering if someone can help me with defining the variable "C"
Option Explicit
Private Sub Worksheet_Change(ByVal Target As Range)
On Error Resume Next
'Loop through myRng
For Each c In Sheets(1).Range("myRng")
'Strip off "=SHEET1!" from the formula, leaving just
'the cell reference e.g. E11
addStr = Right(c.Formula, Len(c.Formula) _
- WorksheetFunction.Find("!", c.Formula))
'Set the Font color based on the Font color of the
'referenced cell in Sheet2
c.Font.ColorIndex = Sheets(2).Range(addStr).Font.ColorIndex
Next
End Sub
im not strong with vba at all, so any help is appreciated.
basically, the macro strips off the "=" sign off and retains the font color etc.
Bookmarks