View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Gord Dibben Gord Dibben is offline
external usenet poster
 
Posts: 22,906
Default cell content into a note

Roger

Your macro will crash if column A already has Comments, giving user no way to
edit column B long descriptions and re-Comment without deleting orignal Comment
in A

I amended to this..........

Sub CopyDescToComment()
Dim lr As Long, i As Long
lr = Cells(Rows.Count, "A").End(xlUp).Row
For i = 1 To lr
If Cells(i, 1).Comment Is Nothing Then
Cells(i, 1).AddComment
Cells(i, 1).Comment.Text Text:="" & Cells(i, 2).Value
Else
Cells(i, 1).Comment.Text Text:="" & Cells(i, 2).Value
End If
Next
Columns("B:B").EntireColumn.Hidden = True
End Sub


Gord Dibben MS Excel MVP

On Thu, 1 Nov 2007 23:42:04 -0000, "Roger Govier"
<rogerattechnology4NOSPAMu.co.uk wrote:

Hi Chuck

This small macro should do the trick

Sub CopyDescToComment()
Dim lr As Long, i As Long
lr = Cells(Rows.Count, "A").End(xlUp).Row
For i = 1 To lr

Cells(i, 1).AddComment
Cells(i, 1).Comment.Text Text:="" & Cells(i, 2).Value

Next
Columns("B:B").EntireColumn.Hidden = True
End Sub

Copy the macroAlt+F11Insert ModulePaste code into white paneAlt+F11 to
return to Excel sheet.

ToolsMacroRunhighlight macro nameRun