I hope this is an easy one.
I want to insert an adjacent column IF there are any comments in a column.
I would like to then use the following code to insert the comments into the empty fields:
Sub ShowCommentsNextCell()
Application.ScreenUpdating = False
Dim commrange As Range
Dim mycell As Range
Dim curwks As Worksheet
Set curwks = ActiveSheet
On Error Resume Next
Set commrange = curwks.Cells _
.SpecialCells(xlCellTypeComments)
On Error GoTo 0
If commrange Is Nothing Then
MsgBox "no comments found"
Exit Sub
End If
For Each mycell In commrange
If mycell.Offset(0, 1).Value = "" Then
mycell.Offset(0, 1).Value = mycell.Comment.Text
End If
Next mycell
Application.ScreenUpdating = True
End Sub
Can this code be modified to run through all sheets?
I then run a merge macro to combine ll the sheets.
My head hurts.
Thanks
I want to insert an adjacent column IF there are any comments in a column.
I would like to then use the following code to insert the comments into the empty fields:
Sub ShowCommentsNextCell()
Application.ScreenUpdating = False
Dim commrange As Range
Dim mycell As Range
Dim curwks As Worksheet
Set curwks = ActiveSheet
On Error Resume Next
Set commrange = curwks.Cells _
.SpecialCells(xlCellTypeComments)
On Error GoTo 0
If commrange Is Nothing Then
MsgBox "no comments found"
Exit Sub
End If
For Each mycell In commrange
If mycell.Offset(0, 1).Value = "" Then
mycell.Offset(0, 1).Value = mycell.Comment.Text
End If
Next mycell
Application.ScreenUpdating = True
End Sub
Can this code be modified to run through all sheets?
I then run a merge macro to combine ll the sheets.
My head hurts.
Thanks