I am using the following macro to creat comments based on the contents of certain cells. Everything works except the it resizes the Comment Boxes exponentially. The Last comment box in the range seems to be the default size, the next to last a little bigger, then it start getting even larger and larger until the first comment in the colomn.
Sub InsertComm() Dim RgPartnumb As Range Dim NRg As Range Set RgPartnumb = Range(Range("B2"), Range("B2").End(xlDown)) On Error Resume Next For Each NRg In RgPartnumb With NRg .Comment.Delete...................................
when i use a macro to add a comment to one of my cells, if i put in too much text the box doesn't resize itself and you can only read part of the comment. how to resize the comment box to the size of the text i put in?
The comment boxes keep changing shape and location in my spreadsheet. Some are completely smashed together, while others are extraodinarily wide. I had them all to the right of the cell they applied to; but now they are all over the place.
Is there a way to control the vertical size of a textbox, so that we could type in a List of Instructions to our operator, and the textbox would resize depending on the numbers of instructions in the box. Also the items in the cells beneath the textbox would need to move down, to allow for the resized textbox.
Adding ' in the beginning of a line converts the rest into comment line. I wonder if there is an easy way to convert a huge area into comment line to try something on code. I couldn't find such an option in the menu.
I use this to read cell content, add some text/characters (ie. [ and ]) and change the properties of the complete cell
Sub COMMENT() Worksheets("DVD Lijssie").Activate If ActiveCell.Value 0 Then ' Change all in to ... ... ... ActiveCell.FormulaR1C1 = ActiveCell.Value & " " & "]" & " " & "[" With ActiveCell.Font .Name = "Arial Narrow" .Size = 8 .ColorIndex = 16 End With End If End Sub HOW can I change this vba-code so it leave's the content of the cell like it is and add some content with the use of let's say TexBox1 and ONLY use different font properties for the newely added content?
I'm using Office 2007 professional and I'm trying to format a cell (merged cell) so that when you enter text and it goes beyond the size of the designed cell that it will automatically continue and shift the additional text downward, like a paragraph. Also it shift everything below down with it. Is this possible? I have already tried wrap text field and AutoFit row height. This keeps it within the cell but it is not visible or printable once you tab out. I would like to have it continue like in a paragraph. Like a word doc may do. It’s visible and it shifts everything below downward as it grows, which also allows it to be printable.
Formula/macro/etc that would enable me to have content of a cell changed based on the content of another cell in the same row.
Example: cell in column D says "PSA" - so I would need the cell in column H for that same row to read "Radio"
I would need an entire sheet scanned to review for these occurrences and make the appropriate changes. I also would need the formula to be inclusive enough to scan for variations in column D cell content (PSA 1, PSA 2, etc).
When I'm moving around in an Excel sheet, I want to have a keyboard shortcut that Autofits only the column I am "in", and only to the width of the cell I'm "in". So I can arrow-key into a cell, hit ctrl-shift-W or whatever, and the column will autofit.
I try Cells.EntireColumn.AutoFit but that's not what I want, it autofits every column. Sometimes this is not appropriate and I want to do it manually for the columns I want auto-fit.
I guess the more general question is how do I write VBA code for the column I am in and not every column or a specific column - not Columns("A:I") or whatever, it's going to be a different column every time depending on what cell I'm editing.
I have a document that I created that has merged cells. In order to autofit the rows of this document, I referenced the merged cells in singular cells that are not visible to the users of the document. (They are not hidden)
It had been working relatively nicely, but now the autofit function is not working correctly. If I copy and paste values into the cell it will work, but this would not be my ideal solution. I have tried playing with the number format, which works for the most part if I set it to "&" - text. It doesn't work for some longer cells with line breaks in them.
how to copy the contents of multiple comment boxes and paste in a single comment box.
The big picture is that I have a number of cells with numerical values in and text in comment boxes. I want to be able to click a button to copy the contents of the comment boxes and paste them, along with the numerical value from the cell, into a single comment box, ordered by highest to lowest value within the comment box, then delete the original cells and comments.
I am quite new to VBA but have been coping quite well so far with information of the web and analysing recorded macros.
For a table like the one below produced for the sake of example (actual is much much bigger) I want to make it list rows that are true for a certain column for a certain variable in the matrix. So for say water terrain, which types of activity can I do i.e. swimming. Or for Offroad the activites which I can't do i.e. Run and Swim.
ActivityWaterRoadOffroad Jog nym Run nyn Walk nyy Swim ynn y=yes n=no m=maybe
Basically it is a if statement saying that if the selected cell falls between 1/01/06 and 31/01/06 then Jan would be selected. The end part is not a problem; I’m just not sure how to write the one line of code that would test if the cell falls between the two dates. I attemped to create it as shown in the code attached below but wasn't successful. I used an else if statement to test the other 11 months.
Sub test() Dim SelectDate As Range Set SelectDate = Range("SelectedDate") If selectedDate >= 1 / 1 / 2006 And selectedDate <= 31 / 1 / 2006 Then ActiveSheet. PivotTables("PivotTable1").PivotFields("PnLDate").CurrentPage = _ "Jan" ElseIf selectedDate >= 1 / 2 / 2006 And selectedDate <= 28 / 2 / 2006 Then
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;
I am using VBA to create a word document (.docx). This word document contains plain text content controls as well as picture content controls. I then use VBA to automatically select a picture based on the code below
Code: Set oCC = Word.ActiveDocument.SelectContentControlsByTitle("TabPic").Item(1) On Error GoTo TabErrorHandler oCC.Range.InlineShapes.AddPicture Filename:="X:XFERANDREW-TDCD " & LblVL &
After the document has been closed down I try to open it again and I am told "The file cannot be opened because there are problems with the contents."
When I click details it says "Unspecified error" and "Location: Part: /word/document.xml, Line: 2, Column: 0"
If I click ok it says "Word found unreadable content in "". Do you want to recover the contents of this document? If you turst the source of this document, click Yes.
Clicking Yes opens the document with all the contents and it is now renamed to Document 1. If I click no it does not open.
I have some code that finds the appropriate string for a comment from another sheet. I then want to add the string to the appropriate range selection but am encountering an Object Variable or With Block Variable Not set on this section of
Range("C" & i).Select ActiveCell.Comment.Delete <== Here Or the Next line ActiveCell.AddComment (Commenta) ActiveCell.Comment.Shape.TextFrame.AutoSize = True