How can I combine Intersect(Target, Range("StockQuotes
") into this sub so that I can apply the one sub to two separate ranges?
Code:Private Sub Worksheet_Change(ByVal Target As Excel.Range) Dim rCell As Range Dim rChange As Range On Error GoTo ErrHandler Set rChange = Intersect(Target, Range("ExchangeRates[XRT]")) If Not rChange Is Nothing Then Application.EnableEvents = False For Each rCell In rChange If rCell > "" Then With rCell.Offset(0, 1) .Value = Now .NumberFormat = "d-mmm" End With Else rCell.Offset(0, 1).Clear End If Next End If ExitHandler: Set rCell = Nothing Set rChange = Nothing Application.EnableEvents = True Exit Sub ErrHandler: MsgBox Err.Description Resume ExitHandler End Sub