I have slight problem with an OnChange Event by Target.
I am looking to be able to change a cell value from one to another, create a comment block that says "person B for person A" , change the color and be done.
If the cell is empty then the code should exit the sub (not working). If the cell has already been change once then I want the comment box to show a second line of who changed what.
What I tried in the comment box, thinking it would keep the value:
I have the following code which deletes the specified value from each cell in column B that contains that value, (note it only deletes the value from that column and not all in the row).
Code: Sub delete1() Dim lr As Long, i As Long With Sheets("Database") lr = .Range("B" & Rows.Count).End(xlUp).Row For i = lr To 2 Step -1 If .Range("B" & i).Value = 1 Then .Range("B" & i).ClearContents Next i End With End Sub
Now what I need is to adapt it slightly so that it also adds a comment to the cell in Column I and the current date in Column L, (on each row where the deleted value was).
The comment would be something like "old data archived" and the date in any format, preferably dd/mm/yyyy.
I need to identify any cells in a range that do not contain text then colour and comment them. I intended to use the following code, however it doesn't work as I expected it to.
With rRange.SpecialCells(xlCellTypeBlanks) If .Count > 0 Then .Interior.ColorIndex = zErrorColour .AddComment "This cell must contain a value" End If End With
The blanks cells are coloured OK but only the first blank cell gets a comment. Is there a reason why I can't add comments to all the cells in the range? And if there is a good reason, then I guess I'm going to have to write a loop to add the comments.
When adding a comment I check for an existing comment, if exist then delete and add new comment and some text in that cell. This works as long as the cell has an existing comment; other wise it advances to the "Else" where I thought I would be entering a comment and text in an empty cell. Why does my macro treat an empty cell as if it has a comment?
I have (several) worksheets that have protection enabled. I have unlocked all the cells that users need access to and locked all the column and row headers/labels. When I enabled protection on the sheets, the ability to add comments was taken away. Is there a way to add comments to an UNLOCKED cell in a PROTECTED worksheet?
I have a few dozen pictures created when a macro runs. They all have unique names. I'd like to add comments to cells, where the cell.value decides which picture to pull. All the examples I've found online show how to do this if you have pictures saved on your hard drive by referencing the file path "c://mydocs/...blahblah/"
Is there a way to reference the pictures I've created/named with my macro?
Here's the snippet of code that creates the pictures and names them:
Code: For i = 2 To Application.CountA(Sheets("Allocation").Rows(1)) Sheets("Allocation").Activate Set rInput = Sheets("Allocation").Range(Cells(1, i), Cells(10, i)) sPicName = "_" & Sheets("Allocation").Cells(1, i) & "_" sSheet = Sheets("Allocation").Cells(3, i) dDate = Sheets("Allocation").Cells(5, i)
[Code] ......
Here are some examples that are close to what I'm looking for.
VBA Popup Pictures - 1108 - Learn Excel from MrExcel Podcast - YouTube VBA Express : Excel - Add pictures that float like comments.
I have a form that has three fields (1. Comments (TEXT), 2. Legacy_Comments (TEXT), 3, Comment date (DATE))
Now my users need to keep adding comments to the comment text box, and when they do it automatically adds the date they entered the comment in the Comment date box. Now my problem is that since they keep adding comments to the comment box, I need to keep track of these comments in the Legacy_Comments (Text box).
For example, the First time a user enters a comment into the (1) comment text box it auto populates the date in the comment date box, and then adds the comment and date to the Legacy_Comment box. the end result is (comment,4/3/2014 now lets say a user needs to add a comment to the comments box tomorrow - I want the legacy_Comment box to then read (comment, 4/3/2014; comment2, 4/4/2014, ...., comment(n),date(n)) OR it can be vice-verse, because I just need to keep track of the comments, I am not worried if the new comments are before or after older (yesterdays / the day before yesterdays comments)
How can I write a VBA code that will always add the new comment to the legacy_comment field, without deleting the comments that were entered previously?
Code: If isnull(me.comment.value) Then Exit Sub ElseIf me.comment.value = true Then me.comment_date.value = date me.legacy_comment.value = me.comment.value & "," & me.comment_date.value & ";" me.legacy_comment.value = me.legacy_comment.value & "," & me.comment_date.value & ";"
It adds the comment only the first time, but it does not concatenate the string from yesterday to the string to today. I do not care which order the comments are, meaning if I added a comment today it can be before OR after the comment from yesterday.
How would you prevent the copy/paste of cells that have comments?
Also, how would you allow cells with comments to be copied and pasted without pasting the comments?
I also have an aside question about the forum advanced search. When searching for multiple search words, how would you type the search to include all words, for example, "prevent" & "paste" & "comments".
I've got a problem involving several Dim'd Variables needing to be added up, they're all Dim'd as Variants though as they can be either strings or numbers at any time.
I need a formula (VBA) to add them up (to add their actual numeric values - not just a "1" if they contain a number) and ignore them all together if they contain string values.
I have a userform that I'm using to add data to a worksheet, with the following
Private Sub CommandButton1_Click() Dim OutSH As Worksheet Set OutSH = Sheets("Sheet1")
OutSH.Cells(nextrow2, 1).Value = Surname.Value OutSH.cells(nextrow2,2).value = ID.value OutSH.cells(nextrow2,3).value = Date.value ...... I need to ensure that duplicate entries are not made for the same person on the same date. The ID is unique to each person.
IF statement that can check for a duplicate and then come up with a dialouge box with some custom text, and then exiting the sub?
I was wondering if there was a way to add comments (that you see in spreadsheets) on a userform in vb editor. So that when you run the form and the user moves the mouse over a textbox then it displays the comment.
I am sure this can be done - I found a similar thread but in a different context to what I need.
I have a user of a workbook who insists on putting irritating red cornered comments in cells, rather than using the handy (and rather large) comments field I put in, especially for her.
For each cell, instead using a comment, I need another way to show a large amount of principaly letter texts, without using hypervincules, and ofcourse comments.
By the way, the same text I enter or modify put in this "way", I need to modify in the MSWord document and viceversa.
I appreciate the linking do not open another app, because the large amount of them I need to work with.
I have a sub that works just fine, but I need to test it for blanks.
Sub AddToComment() Dim rCell As Range Dim cCom As Comment Sheets("Support Detail").Select With Range("e5") .ClearComments Set cCom = .AddComment End With Sheets("Sheet1").Select For Each rCell In Range("a4:a23") cCom.Text Text:=rCell.Text & " " & cCom.Text Next rCell End Sub
I only have 1 line of test in the a4:a23 range - so I'm getting 19 spaces before the text in the comment. If the cells within a4:a23 are blank, how do I ignore them? I'm not sure how to interpret this code, so I'm sure it's probably easy:
I am trying to add numbers from cells if it IsNumeric and for some reason in column K the macro doesnt recognize numbers after row 14?
The range column is "E4:E" Search criteria is the letter "R" in column "E" Then using OffSet, I go thru other columns and process data. Most of the macro works except for column K after row 14?
I have an excel worksheet which has a lot of comments attached to individual cells. Is there a way to convert these comments into a microsft word document along with the contents of the cells to identify where they originated? Also Is it possible to convert just a selection of cells into word document rather than the whole worksheet.
the little red triangle in the corner of cells with comments in. Note: I know how to print the actual comments - however, the colleague I'm assisting only wants to show that there is a comment without actually showing said comment. I'm using Excel 2007.
I have a workbook that I received from a vendor that when I click in a cell a comment appears. There is no line or comment indicator for each comment. So I went into the tools - options - views - comments section and chose no comments. The comments still appear and when I go to the tool bar - view - comments nothing appears. I checked for any VBA code and didn't see anything. I was able to get around this problem by copy/paste special into a new worksheet, but curiosity is killing this cat.
I have several worksheets that have comments in the cells. Most of the comments i have set to "un-hide" and they can be printed. I now have this one spreadsheet where no matter what I do I cannot print the comments.
I must have something turned on or off but for thwe life of me I cannot figure out what it is. I can see the comments on the screen but when I go to print preview they are not there.
I would like to copy and paste comments from one cell to another. I don't want to copy and paste the contents of the cells, just the comments and the formatting that goes with the comments.
I have several comments being placed into a pivot table from a macro. However, all of a sudden, when I changed the source of the Pivot table, the comments now do not appear when hovering over the cell. They only appear way off to the right if I click "review," "Show/hide comment" or "show all comments."
I have been able to use a time stamp code to put a date and time in a cell... I then worked out how to use this to list dates and times in the same cell (instead of replacing the cells contents)... using this
Here is a picture example of what I mean, just randomly found on google: http://www.projectwoman.com/uploaded...ent-763577.jpg
Maybe an insignificant thing I want, but can the line from the comment connecting to the red indicator be removed? Added an example since my comments show up below the selected cell with VBA code.