Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Macro to create Cell Comments


I am trying to create a macro to create Comments in Cells from text i
adjacent cells. Is this possible

--
psmal
-----------------------------------------------------------------------
psmall's Profile: http://www.excelforum.com/member.php...fo&userid=2764
View this thread: http://www.excelforum.com/showthread.php?threadid=50814

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,071
Default Macro to create Cell Comments

Yes, it's possible. Turn on the macro recorder (Tools | Macro Record new
macro...), do whatever it is you want by hand, and turn off the recorder.
In most cases, XL will give you the necessary code that you can then adapt
and customize further.
--
Regards,

Tushar Mehta
www.tushar-mehta.com
Excel, PowerPoint, and VBA add-ins, tutorials
Custom MS Office productivity solutions

In article ,
says...

I am trying to create a macro to create Comments in Cells from text in
adjacent cells. Is this possible?


--
psmall
------------------------------------------------------------------------
psmall's Profile:
http://www.excelforum.com/member.php...o&userid=27647
View this thread: http://www.excelforum.com/showthread...hreadid=508147


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Macro to create Cell Comments


I have tried to do use the recorder and have copied the text but i
copies the exact text into the macro rather than the key process i.e
copy and paste. How do I get it to copy in a relative form rather tha
absolute?

Sub Macro5()
'
' Macro5 Macro
' Macro recorded 03/02/2006 by Philip Small
'

Range("b1").Select
ActiveCell.FormulaR1C1 = "Reversible acid pump inhibitor, Phase I"
Range("A1").Select
Range("A1").Comment.Text Text:="Reversible acid pump inhibitor
Phase I"
Range("B2").Select


End Su

--
psmal
-----------------------------------------------------------------------
psmall's Profile: http://www.excelforum.com/member.php...fo&userid=2764
View this thread: http://www.excelforum.com/showthread.php?threadid=50814

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Macro to create Cell Comments

Sub BB()
Dim rng As Range
Set rng = Range(Cells(1, 2), Cells(Rows.Count, 2).End(xlUp))
For Each cell In rng
If Len(Trim(cell.Value)) < 0 Then
cell.Offset(0, -1).NoteText Text:=cell.Offset.Text
End If
Next

End Sub

--
Regards,
Tom Ogilvy




"psmall" wrote in
message ...

I have tried to do use the recorder and have copied the text but it
copies the exact text into the macro rather than the key process i.e.
copy and paste. How do I get it to copy in a relative form rather than
absolute?

Sub Macro5()
'
' Macro5 Macro
' Macro recorded 03/02/2006 by Philip Small
'

Range("b1").Select
ActiveCell.FormulaR1C1 = "Reversible acid pump inhibitor, Phase I"
Range("A1").Select
Range("A1").Comment.Text Text:="Reversible acid pump inhibitor,
Phase I"
Range("B2").Select


End Sub


--
psmall
------------------------------------------------------------------------
psmall's Profile:

http://www.excelforum.com/member.php...o&userid=27647
View this thread: http://www.excelforum.com/showthread...hreadid=508147



  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,302
Default Macro to create Cell Comments

Hi P,

Try:

'=============
Public Sub Tester()
Dim rng As Range
Dim rCell As Range
Dim sStr As String

Set rng = Selection '<<==== CHANGE

For Each rCell In rng.Cells
With rCell
On Error Resume Next
.Offset(0, 1).Comment.Delete
On Error GoTo 0
.Offset(0, 1).AddComment Text:=.Text
End With
Next rCell
End Sub
'<<=============


---
Regards,
Norman



"psmall" wrote in
message ...

I am trying to create a macro to create Comments in Cells from text in
adjacent cells. Is this possible?


--
psmall
------------------------------------------------------------------------
psmall's Profile:
http://www.excelforum.com/member.php...o&userid=27647
View this thread: http://www.excelforum.com/showthread...hreadid=508147





  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 325
Default Macro to create Cell Comments

Good afternoon,

You could try something like this:

Sub Macro1()
Range("E4").Comment.Text Text:=Range("E1").Value
End Sub

to pick up the value of the cell note from cell E1 or

Sub Macro2()
Selection.Comment.Text Text:=Selection.Offset(0, -2).Value
End Sub

to pick up the value of the cell note from the cell two cells to the left

Hope this helps

Have a good weekend

Pete

"psmall" wrote:


I am trying to create a macro to create Comments in Cells from text in
adjacent cells. Is this possible?


--
psmall
------------------------------------------------------------------------
psmall's Profile: http://www.excelforum.com/member.php...o&userid=27647
View this thread: http://www.excelforum.com/showthread...hreadid=508147


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
Automatically create comments based upon cell value and related datain database [email protected] Excel Discussion (Misc queries) 3 April 10th 08 12:31 PM
Create Comments Vinod[_2_] Excel Worksheet Functions 1 November 6th 07 12:27 PM
Macro to create formula in cell WendiL99 Excel Discussion (Misc queries) 2 July 6th 07 06:44 PM
Create & Format XL Comments with VBA AH·C[_13_] Excel Programming 2 December 29th 05 09:46 AM
Create Excel sheet in HTML with comments Luke Webber Excel Programming 2 October 7th 03 02:34 PM


All times are GMT +1. The time now is 07:22 PM.

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"