#1
|
|||
|
|||
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 |
#2
|
|||
|
|||
cell to range (comments)
below vba code do
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. |
#3
|
|||
|
|||
range $a$1:$a5000 in filter
|
#4
|
|||
|
|||
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 |
#5
|
||||
|
||||
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] |
#6
|
||||
|
||||
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] |
#7
|
||||
|
||||
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] |
#8
|
|||
|
|||
ok thanks regards
|
#9
|
|||
|
|||
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 |
#10
|
||||
|
||||
Quote:
Also, when posting code, please use the code tags (on the Advanced menu).
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
#11
|
|||
|
|||
Quote:
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 |
#12
|
||||
|
||||
As I said in my last post:
Quote:
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
#13
|
|||
|
|||
yes, any kind of word
|
#14
|
||||
|
||||
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
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
#15
|
|||
|
|||
^^^thanks MP
|
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 |
Multiple VLOOKUP's checking multiple Cells | OTPM | Excel | 11 | 05-23-2011 11:18 AM |
Concatenate/merge contents of multiple cells | PSYloco | Excel | 2 | 05-14-2011 03:46 PM |
filling multiple cells whislt using Filter | VinceO | Excel | 1 | 05-09-2011 06:38 AM |
How to get cells to calculate time? | jrasche2003@yahoo.com | Excel | 2 | 02-09-2007 07:10 AM |