andrewb90
Well-known Member
- Joined
- Dec 16, 2009
- Messages
- 1,077
Hello all,
I'm not sure if this is possible to do, but I figured I'd ask around and maybe someone smarter than I will have a creative solution.
I have a worksheet change event that highlights the current row that is selected. See below:
Now, in Column D is my list of names, and select names will be affixed with *** at the end indicating that there are important notes on another sheet.
Now, I'd like to, when a row is selected that has important notes (***), have an object appear that can take the user to the page with the notes. (The workbook is protected and that sheet is not visible are there are some many sheets)
Basically, I'd just like a way for the user to quickly access the notes without having to find the right sheet.
Other ideas as a solution that I've had and maybe someone else know how to make them work:
Make the name a hyperlink only when the notes are in place for that particular name. (The first name is D89 and the notes are on Notes!S89)
The other thing that would be very ideal is if comments can be programmed to include the notes.
The challenge with just putting the notes in another column that ref's the appropriate cells is my current layout of the sheet. The column wouldn't be conveniently accessible, and if I just inserted a column, a lot of code would need to changed, which I'd rather not do.
Any comments or ideas would be much appreciated.
I'm not sure if this is possible to do, but I figured I'd ask around and maybe someone smarter than I will have a creative solution.
I have a worksheet change event that highlights the current row that is selected. See below:
Code:
Option ExplicitConst MyAreas = "D4:R18,D20:R34,D36:R50,D52:R66,D68:R82,D89:V106,D108:V125,D127:V144,D146:V163,D165:V192,D194:V207"
Dim a, MyCol As Collection, rng As Range, X As Range
' Highlighting with Conditional Formatting
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Dim i As Long
If Application.CutCopyMode Then Exit Sub
If MyCol Is Nothing Then
' Setup MyCol only once first time
Set MyCol = New Collection
For Each a In Split(MyAreas, ",")
MyCol.Add Range(a)
' Clear CF highligtings in each area for the first time
Range(a).FormatConditions.Delete
Next
End If
If Not X Is Nothing Then
' Clear the previous CF highlighting
X.FormatConditions.Delete
End If
For Each X In MyCol
' Check intersection
Set rng = Intersect(Target, X)
If Not rng Is Nothing Then Exit For
Next
If Not X Is Nothing Then
' Highlight row of MyAreas via CF
i = ActiveCell.Interior.ColorIndex
Set X = X.Rows(rng.Row - X.Row + 1)
With X.FormatConditions.Add(Type:=2, Formula1:=1)
.Interior.ColorIndex = IIf(i < 0, 8, i + 1)
.Font.Bold = True
End With
End If
End Sub
Now, in Column D is my list of names, and select names will be affixed with *** at the end indicating that there are important notes on another sheet.
Now, I'd like to, when a row is selected that has important notes (***), have an object appear that can take the user to the page with the notes. (The workbook is protected and that sheet is not visible are there are some many sheets)
Basically, I'd just like a way for the user to quickly access the notes without having to find the right sheet.
Other ideas as a solution that I've had and maybe someone else know how to make them work:
Make the name a hyperlink only when the notes are in place for that particular name. (The first name is D89 and the notes are on Notes!S89)
The other thing that would be very ideal is if comments can be programmed to include the notes.
The challenge with just putting the notes in another column that ref's the appropriate cells is my current layout of the sheet. The column wouldn't be conveniently accessible, and if I just inserted a column, a lot of code would need to changed, which I'd rather not do.
Any comments or ideas would be much appreciated.