Add Cell Comments Macro
Jan 2, 2007
I am trying to add comments in a selection of cells and where there is a value then the comment should show the formula value of the cell ie if the formula in cell A1 is = 9 + 10 then the comment should show this. This I have got to work, but if I have a comment already the macro fails and I have tried to get round this but I am not clever enough.
Sub InsertingComments()
Dim r As Range
For Each r In Selection
If r.Comment = True Then
View 9 Replies
ADVERTISEMENT
Aug 25, 2006
Among many attempts to insert and autosize a comment using VBA manually, which errored, i recorded the following bit. When running the macro, it does format the cell - text, not the comment - text and errors in the line highlighted in red.
Range("A14").Select
Range("A14").AddComment
Range("A14").Comment.Visible = False
Range("A14").Comment.Text Text:="Ladida"
With Selection
.HorizontalAlignment = xlLeft
.VerticalAlignment = xlTop
.ReadingOrder = xlContext
.Orientation = xlHorizontal
.AutoSize = True
End With
I just want to add
.AutoSize = True
or something to that effect to the bit below. Any suggestions?
Range("A14").Comment.Text "Ladida"
View 5 Replies
View Related
Feb 10, 2007
I am trying to find out if it is possible to do the following
I have an excel workbook with comments in a number of worksheets. I have created a macro so I can list the comments and the value of the cells with comments. The macro creates a new worksheet and list the comments and value this great but I can only get it to create the comments from the sheet which is active. Is there a way of getting all the comment and cell value from all the worksheet (the entire workbook)
this is the code for the macro
Sub shoppinglist()
Application. ScreenUpdating = False
Dim commrange As Range
Dim mycell As Range
Dim curwks As Worksheet
Dim newwks As Worksheet
Dim i As Long
Set curwks = ActiveSheet
On Error Resume Next
Set commrange = curwks.Cells _
.SpecialCells(xlCellTypeComments)
On Error Goto 0
If commrange Is Nothing Then
MsgBox "no comments found"
Exit Sub
End If ...
View 6 Replies
View Related
Oct 8, 2009
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?
View 4 Replies
View Related
Jul 24, 2007
I have a standard laid out spreadsheet, but in column C, D and E, there are comments in each cell which are filled with a lot of text. I would like to set a macro so that whenever an 'a' is in column A, the comments for that row are shown/hidden (the 'a' being a tick symbol in Webdings). So if I place an 'a' in A4 and A23, and click a show/hide button, it causes the comments in C4, D4, E4; C23, D23 and E23 to be displayed, and when it is clicked again (or it could be a separate button), they disappear. If no row has an 'a' in the A column, then the button has no action. I have recorded a Macro of me showing and hiding comments, but of course that is for a specific row.
View 6 Replies
View Related
Jul 12, 2007
Reference the archives at:
http://www.mrexcel.com/archive/VBA/17448.html
How can I modify this sub to skip cells that are empty? I only want cells that are populated within the range to actually display the comment indicator, with the cell text transferred to the comment.
Ideally, I'd also like the text to be moved (not just copied) to the comment and leave an 'X' in the cell, in place of the text that was transferred to the comment, but I'll settle for the action above.
View 9 Replies
View Related
Oct 24, 2007
I am having trouble writing a macro to do the following. Someone had created a spreadsheet a while back that highlighted the cell green and inserted a comment with the person's name and date/time if they changed anything in that cell. The macro works great, but I need a macro to undo the changes.
I would like a macro that will remove all comments from the sheet and revert the cells back to their original color. Since the cells encompass many colors, at the very least, I would like the macro to remove the comments and make the cells the default shading (white).
View 9 Replies
View Related
Aug 16, 2013
I'm wondering if it is at all possible to have a cell comment automatically update depending on what data is input in the cell (via user input, VLOOKUP, etc.)?
For example, if cell A1 contains the text "CHARLES" with a comment saying "Employee of the Month", and is then subsequently updated with the new text "JOHN" (again, via direct input, a VLOOKUP, data validation, etc.) is there a way to have the comment automatically update to say something else, such as "Team Lead" for example?
I've considered using VBA to accomplish my goal, but am unsure how to compose an effective code to do so. I've also considered perhaps creating a named table filled with all the different comment possibilities I would like to have used in this cell and then inputting a formula in either cell A1, or the comment contained therein, that would then call the corresponding text from that table based on the data in cell A1. Honestly, I'm not sure that what I'm trying to do is even possible;
View 4 Replies
View Related
Nov 28, 2013
I am a novice user and not very familiar with Macros or VBA. I took a macro I found on contextures and got it to resize comments that already exist. However, I am trying to get it to also create the comment (with no content) if the comment does not already exist, and then resize it. This is what I have so far:
Code:
Sub ResizeCommentsInSelection()
Dim mycell As Range
Dim myRng As Range
Dim lArea As Long
Set myRng = Selection
[code].....
View 2 Replies
View Related
Aug 9, 2012
I have an Excel 2007 workbook with several sheets, and various cells in several of the sheets have column headers with a description in the same cell enclosed in curly brackets, e.g. Header{Description}. I would like to to keep the column headers in their respective cells, but move (cut) the descriptions along with the brackets to the respective cell comments.
View 1 Replies
View Related
Jul 8, 2009
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.
View 2 Replies
View Related
Jan 7, 2013
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."
View 1 Replies
View Related
Apr 30, 2012
I have inserted a comment on a cell.... what required is the comment should show every time the cell is selected/highlighted with the keyboard - no matter the mouse pointer is on the cell or not.
Whereas, the comments only shows when the mouse pointer touches the cell...
View 4 Replies
View Related
Dec 28, 2006
I have a worksheet with the following in Column E and F respectively:
ID Name
100 aaa
100 bbb
200 ccc
200 ddd
200 eee
300 fff
400 xxx
500 yyy
500 zzz
500 kkk
500 lll
500 mmm
When I input an ID number in Cell A1 and if it is found in the above table, it should bring all the names corresponding to that ID in a cell comment.
The ID Number is repeated in the above table because the names in Colum F are the dependants name for that particular ID.
View 9 Replies
View Related
Feb 15, 2007
I have a list on my first worksheet that is sequentially numbered in the first column, and has work activities in the next column. On my second worksheet, I have those sequential activity numbers as the column headers on a new list. Problem is I don't have any room to label the new list by the activity's actual description(second column, first sheet). If I did, I would just use a simple VLOOKUP.
So, what I would like to do is utilize the VLOOKUP to pass the activity description string to a UDF that will create a comment in those column headers. Then when the user mouses over the activity numbers, the respective activity descripiton will pop-up as a comment thus solving my space problem!
View 8 Replies
View Related
Dec 5, 2007
I would like to be able to sum quantities held in comments. I am using the Ozgrid VBA module to sum cells based on a fill color, and it works incredibly. However, sometimes I only want to sum a fraction of a cell's contents, and I don't want to use separate fill colors for all possible combinations, so I am thinking to have the comment tab contain the quantity that I want to sum. Example: employee has a total hrs worked of 8 but 2.75 of those hours are to be allocated to sick pay. Typically employees are restricted to taking benefit hours in increments of 4 or 8, and I have some coding to handle that situation.
View 4 Replies
View Related
Jan 24, 2008
I need help with my current macro so that it will look in several cells (myrange) if comment(s) are found, write it in a particular cell, so that you end up with all comments written in that cell. If no comment are found then search until the end of the range(or until all comments are found). My current problem is that it is repeatedly writing the comments it finds and I end up with the same number of comments in one cell as number of cells in myrange.
View 9 Replies
View Related
Jun 5, 2014
I have a VBA that can add a comment based on the cell value, however, I need it to do it for the whole worksheet and not just one cell. I am pretty new to using VBA's, so this is the best code I could find that would perform what I need. If there is a way to have it do run a vlookup, instead of me listing all the cases, that would be great as well.
VB:
Sub AddComment()
Dim strText As String
With Range("s6")
Select Case UCase(.Value)
Case "UPT": strText = "UnPaid Tardy/Late"
[Code] .....
View 5 Replies
View Related
Oct 3, 2008
Is it possible to use conditional formatting on a cell if it contains comments.
View 2 Replies
View Related
Apr 29, 2014
I have Main worksheet (sheet 9) and some codes in Sheet 10 which I use as a source for data validation in Sheet 9. So far I have a macro which looks for changes in cells and, when someone chooses a code from the list the macro adds a comment to the cell and populates it with an explanation of the code. The explanations are also in the code worksheet (Sheet 10). It works really nicely but I cannot work out how to remove the comment if the user clears the value in the cell.
My Macro thus far is:
[Code] .....
View 1 Replies
View Related
Jul 9, 2007
I am using a lot of double click routines in my sheet. In order for the sheet to be more user friendly I have used the comments of cells to tell the user what to do. For instance "Double click to choose type" or some such. Everything works great except that after the user selects what they want from the userform and it hides and the focus comes back to the sheet, the comment is in edit mode. While this is not horrible it is not as nice as I would like. I have tried to have my code send the active cell to another cell and then back, but that doesn't seem to work. Does anyone have any ideas on how to keep the comments from going into edit mode?
View 9 Replies
View Related
Apr 16, 2009
I have a spreadsheet with several comments with pictures on cells. I want them to show up when you select the cell, instead of having to put your mouse cursor on it. I found this code, but then it shows the comment on the middle of the spreadsheet. I want the comments to show next to the selected cell.
View 4 Replies
View Related
Jul 15, 2009
I am dealing with large amount of data.
In the first worksheet, there are multiple comments and I need the property of the cell including the comment to be transferred to the second sheet using a formula.
Suppose in "Sheet1" in cell A5 it says "Number of Sales" with a comment "Check everyday".
Know I need to transfer this to say in "Sheet2" in cell A5. So in A5 of Sheet2 I can type
='Sheet1'!A5
This only brings the text and in this example it would say "Number of Sales" without the comment. All i need is for the comment to be joined with the cell.
I do not how to use Visual Basic and need your help
I cannot use Copy Paste in this case because the file is too large.
If there is no comment it should just write the value of the cell and if no value in cell than it should leave it blank. I will attach a file as a example
View 13 Replies
View Related
Sep 12, 2012
I am creating an excel sheet where there is a comments section where the column width is 58 characters. Is it possible for someone putting in comments to have it automatically go to the next row once they enter 55 characters in the row above? I don't want to use wrap text and need to maintain the rows in this section.
View 8 Replies
View Related
Jan 3, 2014
I have a worksheet that has user fillable cells from B11-AR53. I want the user to be able to attach comments to cells and then to be able to print them on secondary sheet. I know that excel already can perform this function, but it references the cell address and I don't like that method. I want to have the comments on the printout indexed and tied to an index number in the cell. Creating another worksheet with the comments only is perfectly fine. I am currently using this formula (below) to index the comments on the worksheet that they are attached to.
Ideally my report/second worksheet would list-
1 - Comment that is indexed as 1 would be here
2 - Comment that is indexed as 2 would be here
....and so forth
Sub CoverCommentIndicator()
Dim ws As Worksheet
Dim cmt As Comment
Dim lCmt As Long
Dim rngCmt As Range
Dim shpCmt As Shape
[Code] .......
View 5 Replies
View Related
Aug 4, 2008
I would like help with a formula or VBA that would show comments based on cell values.
For example, if cell A1 has cell value '2143', I want comments to be 'Twinkle Twinkle Little Stars' and if cell D1 has cell value '4567', I want 'Humpty Dumpty Fall on a Wall', and etc. How can I do it? I have about 35 different cell value categories. I appreciate any help you can give me. Thanks in advance for your time and effort.
View 9 Replies
View Related
Nov 16, 2006
1)After comparison and no difference between the cells
1.1) If the cell selected is blank then there will not be any color
1.2) Else the cell will be colored GREEN
2)After comparison and there is difference between the cells
2.1) Cells wiill be colored RED
However, my code seems to be unable to execute (1.1) . Pls help to see if there's any thing wrong with my code
For K = 1 To 31
For L = 1 To 29
'Do a comparison of the cells
If StrComp(Array_compare(A, 1), Array_compare(A, 2)) = 0 Then
If IsEmpty(Array_compare(A, 1)) Then
Sheets(3).Select
Cells(K, L) = Array_compare(A, 1)
Else
Sheets(3).Select .................
View 9 Replies
View Related
Aug 16, 2007
What I need to do is write a Vba code that will copy the comments (I believe thats the right term, the ones that make a mouseover box and put a red triangle in the corner of the cell) of a cell and paste them into that cell.
View 9 Replies
View Related
Mar 7, 2008
I need to have users be able to modify notes to various pre-set comments on a protected sheet, however I do not want to have them be able to move the comment box (shape)...
View 8 Replies
View Related
May 3, 2008
I have a cell comment on a series of columns and want to show only one column at a
time. For this reason I hide the ones not used, but the cellcomment doesnt move and
is still at the original place. How I move the comment when the original colums between are hidden ?
View 2 Replies
View Related