ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   cell content into a note (https://www.excelbanter.com/excel-worksheet-functions/164487-cell-content-into-note.html)

Chuck[_3_]

cell content into a note
 
hey guys,

just curious if this can be achieved or how it can be achieved

say i have this

Column A Row 1 = Short Description
Column B Row 1 = Long descriptoin

B2:B10 = are all the short descriptions
B2:B10 = are all the long descriptions

is there a way to just put the comment into the short description
cells from the long description cells via a note and then hide the
long description column?

can anyone advise as to how this can be achieved?
cheers


Roger Govier[_3_]

cell content into a note
 
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

--
Regards
Roger Govier



"Chuck" wrote in message
oups.com...
hey guys,

just curious if this can be achieved or how it can be achieved

say i have this

Column A Row 1 = Short Description
Column B Row 1 = Long descriptoin

B2:B10 = are all the short descriptions
B2:B10 = are all the long descriptions

is there a way to just put the comment into the short description
cells from the long description cells via a note and then hide the
long description column?

can anyone advise as to how this can be achieved?
cheers




Gord Dibben

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



Roger Govier[_3_]

cell content into a note
 
Hi Gord

You are quite right. Thanks for picking that up.
I only tested with a first run through, didn't try again after comments had
been added to cells.
Hard slap on wrist duly administered<bg

--
Regards
Roger Govier



"Gord Dibben" <gorddibbATshawDOTca wrote in message
...
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






All times are GMT +1. The time now is 09:12 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com