Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 124
Default Convert cell "contents" into a "comment"

I have a HUGE access database and want to put it into excel. So, I did an
export. Some of the cells have around 350 characters in them and I'd like to
turn those cell contents into "comments" instead. Is there a macro that will
do this for me? It would save me a TON of time.
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 15
Default Convert cell "contents" into a "comment"

If you're talking about making them into actual comments, as in the little
bubbles that pop up when you hover over a cell, then it'd be something like
this:

Let's assume you've got cells in the range A1:B7. Here's the code:

Sub Macro1()
'
' Macro1 Macro
'

'
For Each c In [A1:B7].Cells
c.AddComment
c.Comment.Visible = False
c.Comment.Text Text:=c.Value
Next
End Sub

If you want to clear the cells after you add the comments, add this line
before "Next":

c.Value = ""

Hope that's what you're looking for.

"Ryan" wrote:

I have a HUGE access database and want to put it into excel. So, I did an
export. Some of the cells have around 350 characters in them and I'd like to
turn those cell contents into "comments" instead. Is there a macro that will
do this for me? It would save me a TON of time.

  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 124
Default Convert cell "contents" into a "comment"

That is exactly what I need. I am getting an error with it right now though.
I should note that I have basically zero experience with Macros.

"Caeres" wrote:

If you're talking about making them into actual comments, as in the little
bubbles that pop up when you hover over a cell, then it'd be something like
this:

Let's assume you've got cells in the range A1:B7. Here's the code:

Sub Macro1()
'
' Macro1 Macro
'

'
For Each c In [A1:B7].Cells
c.AddComment
c.Comment.Visible = False
c.Comment.Text Text:=c.Value
Next
End Sub

If you want to clear the cells after you add the comments, add this line
before "Next":

c.Value = ""

Hope that's what you're looking for.

"Ryan" wrote:

I have a HUGE access database and want to put it into excel. So, I did an
export. Some of the cells have around 350 characters in them and I'd like to
turn those cell contents into "comments" instead. Is there a macro that will
do this for me? It would save me a TON of time.

  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 15
Default Convert cell "contents" into a "comment"

What error message (hard to give advice unless you describe the problem)?
Also, a way I learn macro syntax is by recording what I want to do, and then
using Edit to look at the code for what I just did.

"Ryan" wrote:

That is exactly what I need. I am getting an error with it right now though.
I should note that I have basically zero experience with Macros.

"Caeres" wrote:

If you're talking about making them into actual comments, as in the little
bubbles that pop up when you hover over a cell, then it'd be something like
this:

Let's assume you've got cells in the range A1:B7. Here's the code:

Sub Macro1()
'
' Macro1 Macro
'

'
For Each c In [A1:B7].Cells
c.AddComment
c.Comment.Visible = False
c.Comment.Text Text:=c.Value
Next
End Sub

If you want to clear the cells after you add the comments, add this line
before "Next":

c.Value = ""

Hope that's what you're looking for.

"Ryan" wrote:

I have a HUGE access database and want to put it into excel. So, I did an
export. Some of the cells have around 350 characters in them and I'd like to
turn those cell contents into "comments" instead. Is there a macro that will
do this for me? It would save me a TON of time.

  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 22,906
Default Convert cell "contents" into a "comment"

Couled be that some of the cells contain pure numbers or dates(which are
numbers)

Try this change................

Sub Macro1()
Dim c As Range
For Each c In [A1:B7].Cells
c.AddComment
c.Comment.Visible = False
c.Comment.Text Text:=c.Formula
Next
End Sub


Gord Dibben MS Excel MVP

On Fri, 3 Oct 2008 11:34:05 -0700, Ryan
wrote:

That is exactly what I need. I am getting an error with it right now though.
I should note that I have basically zero experience with Macros.

"Caeres" wrote:

If you're talking about making them into actual comments, as in the little
bubbles that pop up when you hover over a cell, then it'd be something like
this:

Let's assume you've got cells in the range A1:B7. Here's the code:

Sub Macro1()
'
' Macro1 Macro
'

'
For Each c In [A1:B7].Cells
c.AddComment
c.Comment.Visible = False
c.Comment.Text Text:=c.Value
Next
End Sub

If you want to clear the cells after you add the comments, add this line
before "Next":

c.Value = ""

Hope that's what you're looking for.

"Ryan" wrote:

I have a HUGE access database and want to put it into excel. So, I did an
export. Some of the cells have around 350 characters in them and I'd like to
turn those cell contents into "comments" instead. Is there a macro that will
do this for me? It would save me a TON of time.




Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Excel - Golf - how to display "-2" as "2 Under" or "4"as "+4" or "4 Over" in a calculation cell Steve Kay Excel Discussion (Misc queries) 2 August 8th 08 01:54 AM
change "true" and "false" to "availble" and "out of stock" inthestands Excel Worksheet Functions 2 July 19th 07 07:05 PM
how to increase size of "name box" and "contents of cell " displa. Stubby- LIBERTY New Users to Excel 2 February 22nd 07 06:43 PM
Count occurences of "1"/"0" (or"TRUE"/"FALSE") in a row w. conditions in the next BCB New Users to Excel 7 May 13th 06 10:02 PM
convert "15000" to "Fifteen thousand" in excel cell? anurag Excel Worksheet Functions 1 May 4th 06 07:58 AM


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

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"