google is not helping on this problem. i have a sheet with IDs in the first 2 columns which are frozen so i can see the column while scrolling. the rest of the columns are dated at the top and this is where scheduled maintenance is input. this is a schedule for items due for 8 vehicles. column A has the vehicle IDs and column B is hiden but contains a status of the vehicle. what i am trying to do is leave column B hiden and input a comment in column A depending on what is in column B which is hiden. i have the comments working correctly except when scrolling to the right, you cannot see the comments anymore. if i could set the comment to position over its own cell it would work just fine. i cant seem to get any sample vba from googling to work. the position never changes and i cant figure it out. here is the code i have so far.
does anyone know how to position the comment over the containing cell? thanks.
Code:
Dim sText As String ' Comment String
Dim i1 As Long ' Counter
Dim sUser As String ' User Name
sUser = Application.UserName
For i1 = 5 To 12
sText = ActiveSheet.Cells(i1, 2).Value
If sText = "Unserviceable" Then
'Deletes Existing Comments
Cells(i1, 1).ClearComments
' Creates Comment
Cells(i1, 1).AddComment
'Cells(i1, 1).Comment.Text Text:=sUser & Chr(10) & sText
Cells(i1, 1).Comment.Text Text:=sText
Cells(i1, 1).Comment.Shape.TextFrame.AutoSize = True
Else
Cells(i1, 1).ClearComments
End If
Next i1