Ironman
Well-known Member
- Joined
- Jan 31, 2004
- Messages
- 1,069
- Office Version
- 365
- Platform
- Windows
Hi
The below code was kindly provided to me some time ago.
All I'm looking for is for the below part of the code to be amended so it also runs (with the relevant amended message boxes) with Sheets "Indoor Bike" in Column K, "Outdoor Bike" in Column I and "Walking" in Column H
Many thanks
The below code was kindly provided to me some time ago.
Code:
Sub GlobalCommentsCell()
If ActiveSheet.Name <> "Training Log" Then Exit Sub
'If Selection.Value <> "" Then Exit Sub
If Selection.Column <> 9 Then
Ans = MsgBox("This routine will only work in Column I!" & vbNewLine & _
"Would you like to move to column I now?", vbYesNo + vbExclamation, "Column Selection Error")
If Ans = vbNo Then Exit Sub
If Ans = vbYes Then
Dim i As Long
i = Selection.Row
Cells(i, 9).Select
End If
End If
On Error GoTo Quit
With Selection
.Interior.ColorIndex = 36
.Interior.Pattern = xlSolid
.Font.Name = "Wingdings"
.Font.Size = 8
.Font.ColorIndex = 15
.Value = "¤"
.Borders(xlEdgeLeft).LineStyle = xlContinuous
.Borders(xlEdgeLeft).Weight = xlThin
.Borders(xlEdgeLeft).ColorIndex = 15
With Application
.SendKeys "i"
.Dialogs(xlDialogDataValidation).Show
End With
Quit:
Err.Clear
End With
End Sub
Code:
If ActiveSheet.Name <> "Training Log" Then Exit Sub
'If Selection.Value <> "" Then Exit Sub
If Selection.Column <> 9 Then
Ans = MsgBox("This routine will only work in Column I!" & vbNewLine & _
"Would you like to move to column I now?", vbYesNo + vbExclamation, "Column Selection Error")
Many thanks
Last edited: