Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 02-03-2012, 11:36 PM
gsrikanth gsrikanth is offline how to gave comments to multiple cells at a time Windows XP how to gave comments to multiple cells at a time Office XP
Competent Performer
how to gave comments to multiple cells at a time
 
Join Date: Dec 2011
Posts: 133
gsrikanth is on a distinguished road
Default how to gave comments to multiple cells at a time

columns consist of 1,2
i selected only 1 value of cells
i want to add comments to all the 1 value cells
by selecting all 1 by shift + ctl +down
i can put same comments to all the cells?

If you want to have the same comment applied on many cells you could


apply it to a single cell, then use the copy and paste special tool bar commands (under Edit)
In Paste Special select "Comments"

but value is going of that cell
Reply With Quote
  #2  
Old 02-04-2012, 05:56 AM
gsrikanth gsrikanth is offline how to gave comments to multiple cells at a time Windows XP how to gave comments to multiple cells at a time Office XP
Competent Performer
how to gave comments to multiple cells at a time
 
Join Date: Dec 2011
Posts: 133
gsrikanth is on a distinguished road
Default cell to range (comments)

below vba code do
  1. Double click on a cell
  2. Write the text to be placed in the comment
  3. Press Enter


I want to not to a cell, I want this to range, or particular a1, f2, h25 cell how?

http://www.vbaexpress.com/kb/getarticle.php?kb_id=893
'Code to be placed in the worksheet(s) you want to use this in
Option Explicit
Public oldRange As Range

Private Sub Worksheet_SelectionChange(ByVal Target As Excel.Range)
On Error Resume Next
Dim rng As Range
Set rng = Target(1, 1)

oldRange.Comment.Visible = False

With rng
If Not .Comment Is Nothing Then
If .Comment.Visible = False Then
.Comment.Visible = True
Else
.Comment.Visible = False
End If
End If
End With

Set oldRange = Target(1, 1)
End Sub

Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Excel.Range, Cancel As Boolean)
On Error Resume Next
Dim cmtText As String
Dim inputText As String

If Target.Comment Is Nothing Then
cmtText = InputBox("Enter info:", "Comment Info")
If cmtText = "" Then Exit Sub
Target.AddComment Text:=cmtText
Target.Comment.Visible = True
Target.Comment.Shape.TextFrame.AutoSize = True 'Remove if you want to size it yourself
Else
If Target.Comment.Text <> "" Then
inputText = InputBox("Enter info:", "Comment Info")
If inputText = "" Then Exit Sub
cmtText = Target.Comment.Text & Chr(10) & inputText
Else
cmtText = InputBox("Enter info:", "Comment Info")
End If
Target.ClearComments
Target.AddComment Text:=cmtText
Target.Comment.Visible = True
Target.Comment.Shape.TextFrame.AutoSize = True 'Remove if you want to size it yourself
End If

Cancel = True 'Remove this if you want to enter text in the cell after you add the comment
End Sub.
Reply With Quote
  #3  
Old 02-04-2012, 06:47 AM
gsrikanth gsrikanth is offline how to gave comments to multiple cells at a time Windows XP how to gave comments to multiple cells at a time Office XP
Competent Performer
how to gave comments to multiple cells at a time
 
Join Date: Dec 2011
Posts: 133
gsrikanth is on a distinguished road
Default

range $a$1:$a5000 in filter
Reply With Quote
  #4  
Old 02-04-2012, 08:29 AM
gsrikanth gsrikanth is offline how to gave comments to multiple cells at a time Windows XP how to gave comments to multiple cells at a time Office XP
Competent Performer
how to gave comments to multiple cells at a time
 
Join Date: Dec 2011
Posts: 133
gsrikanth is on a distinguished road
Default it not comming

Private Sub cmdMakeComment_Click()
Dim rng As Range

Set rng = ActiveSheet.Cells(4, 4)
Set rng = ActiveSheet.Cells(6, 5)
Set rng = ActiveSheet.Cells(7, 5)
Set rng = ActiveSheet.Cells(8, 4)
Set rng = ActiveSheet.Cells(9, 5)
Set rng = ActiveSheet.Cells(8, 5)
If rng.Comment Is Nothing Then rng.AddComment
rng.Comment.Text "It is now " & Format(Now)
End Sub
Reply With Quote
  #5  
Old 02-06-2012, 08:26 PM
macropod's Avatar
macropod macropod is offline how to gave comments to multiple cells at a time Windows 7 64bit how to gave comments to multiple cells at a time Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,956
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

Hi gsrikanth,

If you select the first destination cell, then Ctrl-click on each of the other destination cells, you can use the Paste Comment function that way.
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
  #6  
Old 02-06-2012, 08:30 PM
macropod's Avatar
macropod macropod is offline how to gave comments to multiple cells at a time Windows 7 64bit how to gave comments to multiple cells at a time Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,956
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

Given your other posts, perhaps you want something like:
Code:
Sub AddComments()
Dim ocel As Range
For Each ocel In Selection.Cells
  If ocel.Value = 1 Then
    ocel.AddComment "Comment Text"
  End If
Next
End Sub
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
  #7  
Old 02-06-2012, 08:34 PM
macropod's Avatar
macropod macropod is offline how to gave comments to multiple cells at a time Windows 7 64bit how to gave comments to multiple cells at a time Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,956
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

I have merged your three threads about adding comments to multiple cells. Please don't start multiple threads on the same topic - if you have additional information/questions, add them to the original thread.
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
  #8  
Old 02-06-2012, 11:37 PM
gsrikanth gsrikanth is offline how to gave comments to multiple cells at a time Windows XP how to gave comments to multiple cells at a time Office XP
Competent Performer
how to gave comments to multiple cells at a time
 
Join Date: Dec 2011
Posts: 133
gsrikanth is on a distinguished road
Default

Quote:
Originally Posted by macropod View Post
I have merged your three threads about adding comments to multiple cells. Please don't start multiple threads on the same topic - if you have additional information/questions, add them to the original thread.
ok thanks regards
Reply With Quote
  #9  
Old 02-07-2012, 02:05 AM
gsrikanth gsrikanth is offline how to gave comments to multiple cells at a time Windows XP how to gave comments to multiple cells at a time Office XP
Competent Performer
how to gave comments to multiple cells at a time
 
Join Date: Dec 2011
Posts: 133
gsrikanth is on a distinguished road
Default

above code is comming for value 1 i want to general lies comming error need some correction

Code:
Sub AddComments()
Dim ocel As Range 
For Each ocel In Selection.Cells
  If Len(ocel.Value) > 0 Then
    ocel.AddComment "Comment Text"
  End If
Next
End Sub

Last edited by macropod; 02-07-2012 at 04:04 AM. Reason: Added code tags
Reply With Quote
  #10  
Old 02-07-2012, 04:05 AM
macropod's Avatar
macropod macropod is offline how to gave comments to multiple cells at a time Windows 7 64bit how to gave comments to multiple cells at a time Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,956
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

Quote:
i want to general lies comming error need some correction
I have no idea what you mean. Please explain.

Also, when posting code, please use the code tags (on the Advanced menu).
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
  #11  
Old 02-07-2012, 04:39 AM
gsrikanth gsrikanth is offline how to gave comments to multiple cells at a time Windows XP how to gave comments to multiple cells at a time Office XP
Competent Performer
how to gave comments to multiple cells at a time
 
Join Date: Dec 2011
Posts: 133
gsrikanth is on a distinguished road
Default

Quote:
Originally Posted by macropod View Post
I have no idea what you mean. Please explain.

Also, when posting code, please use the code tags (on the Advanced menu).
what is code tags, where it will be?

previously you given ****If ocel.Value = 1 Then ****
i changed to ****If Len(ocel.Value) > 0 Then **** error comming
i want to use not only for 1, but also for constants
Reply With Quote
  #12  
Old 02-07-2012, 02:43 PM
macropod's Avatar
macropod macropod is offline how to gave comments to multiple cells at a time Windows 7 64bit how to gave comments to multiple cells at a time Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,956
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

Quote:
Originally Posted by gsrikanth View Post
what is code tags, where it will be?
As I said in my last post:
Quote:
on the Advanced menu
Quote:
Originally Posted by gsrikanth View Post
i want to use not only for 1, but also for constants
What kind of constants? Anything other than a formula could be regarded as a constant.
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
  #13  
Old 02-07-2012, 10:35 PM
gsrikanth gsrikanth is offline how to gave comments to multiple cells at a time Windows XP how to gave comments to multiple cells at a time Office XP
Competent Performer
how to gave comments to multiple cells at a time
 
Join Date: Dec 2011
Posts: 133
gsrikanth is on a distinguished road
Default

Quote:
Originally Posted by macropod View Post
As I said in my last post:


What kind of constants? Anything other than a formula could be regarded as a constant.
yes, any kind of word
Reply With Quote
  #14  
Old 02-07-2012, 11:04 PM
macropod's Avatar
macropod macropod is offline how to gave comments to multiple cells at a time Windows 7 64bit how to gave comments to multiple cells at a time Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,956
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

I can't see why you'd want to add the same comment to all such cells but, if that's what you want, try:
Code:
Sub AddComments()
Dim ocel As Range
On Error Resume Next
For Each ocel In ActiveSheet.UsedRange.SpecialCells(xlCellTypeConstants)
  ocel.Comment.Delete
  ocel.AddComment "Comment Text"
Next
End Sub
Note that this code will replace any existing comments. If you don't want to do that, delete or comment-out the 'ocel.Comment.Delete' line.
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
  #15  
Old 02-08-2012, 04:53 AM
gsrikanth gsrikanth is offline how to gave comments to multiple cells at a time Windows XP how to gave comments to multiple cells at a time Office XP
Competent Performer
how to gave comments to multiple cells at a time
 
Join Date: Dec 2011
Posts: 133
gsrikanth is on a distinguished road
Default

^^^thanks MP
Reply With Quote
Reply

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Macro to Insert Text Into Cells Having Multiple Lines revans611 Excel Programming 4 10-24-2011 10:15 AM
how to gave comments to multiple cells at a time Multiple VLOOKUP's checking multiple Cells OTPM Excel 11 05-23-2011 11:18 AM
how to gave comments to multiple cells at a time Concatenate/merge contents of multiple cells PSYloco Excel 2 05-14-2011 03:46 PM
how to gave comments to multiple cells at a time filling multiple cells whislt using Filter VinceO Excel 1 05-09-2011 06:38 AM
how to gave comments to multiple cells at a time How to get cells to calculate time? jrasche2003@yahoo.com Excel 2 02-09-2007 07:10 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 07:26 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2024 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft