Hello,
This is driving me crazy and I cannot figure out what I am doing wrong. I have a code that checks a column for a value, once it locates that value it places some text in an adjacent cell 3 rows earlier. I have used the code before so I know it usually works, but in this one is not working and I cannot figure out what I need to do to adjust the code:
The line that is showing mismatch error is:
If .Value = Range("H9").Value Then
Comments are string and the cell range H9 is a string so I cannot figure out why I keep getting the mismatch error or how to resolve this issue.
If someone can help me, I would really appreciate it!
This is driving me crazy and I cannot figure out what I am doing wrong. I have a code that checks a column for a value, once it locates that value it places some text in an adjacent cell 3 rows earlier. I have used the code before so I know it usually works, but in this one is not working and I cannot figure out what I need to do to adjust the code:
Code:
Sub Comments()'
' Comments Macro
'
'
Dim Comments As String
Dim msg As String
msg = "Type in Comment -- To make blank select cancel."
Comments = InputBox(msg)
Sheets("Active_Teams").Select
Dim LR As Long, i As Long
With Sheets("Active_Teams")
LR = .Range("F" & Rows.Count).End(xlUp).Row
For i = 1 To LR
With .Range("F" & i)
If .Value = Range("H9").Value Then
.Offset(0, -3).Select
Selection.Value = Comments
Sheets("Program Change Distribution").Select
Exit Sub
End If
End With
Next i
End With
End Sub
The line that is showing mismatch error is:
If .Value = Range("H9").Value Then
Comments are string and the cell range H9 is a string so I cannot figure out why I keep getting the mismatch error or how to resolve this issue.
If someone can help me, I would really appreciate it!