Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
Mik Mik is offline
external usenet poster
 
Posts: 42
Default Copy the contents of a range of cells to a single comment(indicator)?

How do you copy the contents of a range of cells to a single comment
(indicator)?

I have a range of cells ("n12:n14"), and want to copy the contents
into a single comment indicator within the activecell.

anybody help?

Thanks
Mik
  #2   Report Post  
Posted to microsoft.public.excel.programming
Mik Mik is offline
external usenet poster
 
Posts: 42
Default Copy the contents of a range of cells to a single comment(indicator)?

On 29 Apr, 23:11, Mik wrote:
How do you copy the contents of a range of cells to a single comment
(indicator)?

I have a range of cells ("n12:n14"), and want to copy the contents
into a single comment indicator within the activecell.

anybody help?

Thanks
Mik


I Have an addition / further thought....

I wish to add the selected text from a 3 column listbox (userform) to
the active cell as a comment (with indicator).

Can anybody advise how this is done using vba?

Mik

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default Copy the contents of a range of cells to a single comment(indicator)?

I created a small userform with a listbox and two commandbuttons on it (ok and
cancel).

This was the code behind the userform:

Option Explicit
Private Sub CommandButton1_Click()
Dim iCtr As Long
Dim myStr As String

If Me.ListBox1.ListIndex < 0 Then
Exit Sub 'nothing chosen yet
End If

With Me.ListBox1
myStr = .List(.ListIndex, 0) _
& "--" & .List(.ListIndex, 1) _
& "--" & .List(.ListIndex, 2)
End With

With ActiveCell
If .Comment Is Nothing Then
'no existing comment
Else
.Comment.Delete
End If
.AddComment Text:=myStr
End With

End Sub
Private Sub CommandButton2_Click()
Unload Me
End Sub
Private Sub UserForm_Initialize()
Dim iCtr As Long

With Me.ListBox1
.ColumnCount = 3
.ColumnWidths = "30,30,30"
'add some test data
For iCtr = 1 To 3
.AddItem "A" & iCtr
.List(.ListCount - 1, 1) = "B" & iCtr
.List(.ListCount - 1, 2) = "C" & iCtr
Next iCtr
End With

End Sub


Mik wrote:

On 29 Apr, 23:11, Mik wrote:
How do you copy the contents of a range of cells to a single comment
(indicator)?

I have a range of cells ("n12:n14"), and want to copy the contents
into a single comment indicator within the activecell.

anybody help?

Thanks
Mik


I Have an addition / further thought....

I wish to add the selected text from a 3 column listbox (userform) to
the active cell as a comment (with indicator).

Can anybody advise how this is done using vba?

Mik


--

Dave Peterson
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
Show Excel comment on mouseover but not the comment indicator [email protected] Excel Programming 6 June 30th 15 02:30 AM
lookup cell reference and copy contents and comment from a range GarySW Excel Worksheet Functions 0 May 28th 09 06:14 PM
How do I copy the contents of a range of text cells and paste into one cell? davfin Excel Discussion (Misc queries) 7 July 4th 06 08:16 AM
Copy column range of "single word" cells with spaces to a single c nastech Excel Discussion (Misc queries) 3 February 15th 06 05:04 PM
How to I copy text from a range of cells to another single cell? WRT Excel Discussion (Misc queries) 2 December 18th 05 06:17 AM


All times are GMT +1. The time now is 11:43 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"