Hi All,
I am trying to write a small sub to switch across all my active workbook sheet, cell values with cell comments.
It work in a given selection.
I am struggling to run it across active cell on each of my workbook sheets.
Can somebody help?
Thanks
---------------
Sub SwitchValueCOmment()
Dim Buffer1, Buffer2, Buffer3 As String
On Error Resume Next
Worksheets(1).Activate
Application.ActiveCell.Select
'ActiveSheet.Range("B12:B19"
.Select
For Each cell In Selection
If cell.Comment.Text <> "" Then
Buffer1 = cell.Value
Buffer2 = cell.Comment.Text
Buffer3 = Replace(Buffer2, "Real Estate User:", ""
cell.Value = cell.Comment.Text
cell.Comment.Text Text:=Buffer1
End If
Next
End Sub
I am trying to write a small sub to switch across all my active workbook sheet, cell values with cell comments.
It work in a given selection.
I am struggling to run it across active cell on each of my workbook sheets.
Can somebody help?
Thanks
---------------
Sub SwitchValueCOmment()
Dim Buffer1, Buffer2, Buffer3 As String
On Error Resume Next
Worksheets(1).Activate
Application.ActiveCell.Select
'ActiveSheet.Range("B12:B19"
For Each cell In Selection
If cell.Comment.Text <> "" Then
Buffer1 = cell.Value
Buffer2 = cell.Comment.Text
Buffer3 = Replace(Buffer2, "Real Estate User:", ""
cell.Value = cell.Comment.Text
cell.Comment.Text Text:=Buffer1
End If
Next
End Sub