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 &
[Code].....
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 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 have a list of 12.000 pictures which have to be "connected" with the article number (1000) & color (21). Here starts the problem... Each article usually has more than 2 colors, but is listed only once per row and the colors are stated in columns.
What I would need is a macro or function that would do from such structure:
art description color1 color2 color 3
1000 product A 21 22 23 1001 product B 19 23
this:
art. description picture
1000-21 product A, color 21 1000-21.jpg 1000-22 product A, color 21 1000-21.jpg 1000-23 product A, color 21 1000-21.jpg 1001-19 product B, color 21 1001-19.jpg 1001-23 product B, color 21 1001-19.jpg
1. check if the row in color columns is not null 2. if this is true, then I would like to copy the entire row & paste it below existing 3. then the "art." column would be changed (=A2&"-"&C2), so the article woul get suffix of the color (and column "picture" would be created, maybe something like =A2&".jpg") 4. if any other color column in the same row is greater than null, then proceed to next color & repeat steps 2. & 3., else go to next row 5. until all 5000 rows are converted in about 12.000 rows.
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).
I have several data sets that that have the same column headers (product portfolio data, split by categories into different workbooks) and the same structure and want to merge them to create summaries in a pivot table that I can slice the way I need to look at the data (e.g., by "Category 1" level, "Category 2" level, etc..). The messy way would be to just copy/paste all data in one master set and then create one pivot from it. The problem is that this a) takes a lot of time since I have several data sets and b) the content of these data sets is constantly changing, so I would need to constantly update the master data set by replacing updated sub sets.
I was hoping that I can use PowerPivot for that which is apparently not the case - as I understand PowerPivot is only being used to link data sets that contain a column with an identical key to then basically do on a larger scale what a vlookup would do. Is there a way to do this with PowerPivot?
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
I've got two columns with data in only some of the cells in them. I need the cells with data in them to be put after each other at the top of a new column. Is there a formula for this?
Basically i need a formula that will look at the message content on a seperate sheet (Data sheet on the attached example) and multiple by the volume of the message type to return a value on a seperate sheet.
The problem i have is our messages appear in the data as seperate lines based on the entire message content, with a quantity of how many times that exact message was sent on a day DESPITE there being many variations of a message, they may all only equate to 1 or 2 actual message types.
In the example you will see the Data tab showing Example message 1, Example message 1.1 etc. All of the Example message 1-1.5 are actually the same message type (same applies to Example message 2) and i need to be able to have formula that groups and counts these to return a value by message type * by the quantity per day. So in the example, Example message 1 would return a result of 10 on the main sheet.
I have a spreadsheet that has mostly locked cells but randomly placed unlocked cells.
The sheet is completed, often saved and printed. We then go back into it and use it for another customer calculation and need to ensure all previous entries are removed. With the locked cells you can't simply highlight an area to clear so I am wondering if there is a way to clear the unlocked cells in one step other than entering on each on to clear.
Would there be any way that if we cleared the first cell the others would clear?
I have two columns, the left of which consists of merged cells. I got the document in this format, but to work with it, I need to unmerge the cells in the left column - simple enough.
However, when I do so, only the top cell in the group contains any actual data. What I get is this:
Age 18-20
21-25
26-30
And I would like it to look this way:
Age 18-20
Age 21-25
Age 26-30
Is there a simple way to get this result automatically when unmerging the cells? And if not, what is the fastest solution to avoid tons of manual copying?
I have a long list that has all the services from our stores. I´m using the formula below to count how many services does each store have that are over 20 days old.
Now i´m wondering is it possible to make a macro that would delete all the cells in the range that do not match the criteria of my formula?
With one exception in sheet G cell A2--> has the number of the store. There are over 40 stores so each store has a number 10, 20, 30, etc... This is the part of the formula that determines witch store it is counting (G!$A$2:$A$6000=$B4) B4=10 in this case and B5 would be 20 and so on... By modifying that one part i can count old services for all of our stores.
Now I want the macro to delete all services from the list that are not over 20 days old and belong to the store 10 (B4). If it would delete everything that dont match that formulas criteria i could not get a list of old services for our other stores.
What i´m trying to accomplish is get a list of the services that are over 20 days old. I´m now picking them from the list by hand and that takes a really long time. Because of the number of the stores and the size of the range.
The gaps are of varying length. So far I have been playing with the Range("a1").Select ActiveCell.Offset(1, 0).Select Do While Not IsEmpty(ActiveCell) 'do copy action ActiveCell.Offset(1, 0).Select Loop of course, this stops when it reaches a blank cell.
I think the best way to do it is if I set a range, and then get excel to go down the column and copy whereever there is cell content.
I need to test a condition that at least one cell in the range (A1:A10) is not numeric. Is the syntax smth like: IsNumeric=False or smth like that? I cannot recall.
What I'm trying to do is determine what the content is in a particular cell. In the spreadsheet, some of the cells are merged, some not. I'm using ActiveCell to read the content of the normal cells, but its not working for merged cells.
I am trying to lock the unused cells in 32, 2 column by 7 row named ranges, based on whether or not two cells, above each range are equal or less than each other. In other words while one of the cells is less than or equal to the second cell all cells in the range below should be unlocked, as soon as that condition is no longer true the blank cells need to be locked.
I am trying to use this in the Workbook_Sheetcalculate so that the macro will run automatically.
I have a document I was directed to fill in. I was instructed to only use a certain number of characters and then drop into another cell below it for paragraphs of text. I have now been told they made a mistake, need me to copy all the related cells for a specific paragraph and drop them into a single cell.
Can I copy the text in multiple cells, and then drop the cell formating of those copied cells and drop the content into one single cell. Either word wrapping the content or soft returns for what looks like paragraphs again?
I want to format a range of cells based on the name listed in a cell in column A (starting @A6). I currently do this manually. It is to help me visually see the line I am working with and for what person.
I am almost certain that is going to take a VBA, but I know little to nothing about setting one up.
I'm trying to use the Worksheet_Change event to replace all cleared cells with a default formula. This allows users to override the default, or restore the default when they need to:
If Not Intersect(Target, Range("Data")) Is Nothing And Target.Value = "" Then Range("DefaultFormula").Copy ActiveSheet.Paste ActiveSheet.Application.CutCopyMode = False End If
Here are the results with various different regions selected:
Single cell selected and cleared -- works. Multiple cells selected and cleared -- doesn't work if the first area selected contains more than one cell. Otherwise, it works, no matter how many other areas are selected.
Example1: Selected range is (D2:E2, G2) in that order, it does not copy the formula into the cleared cells. Example2: Selected range is (G2, D2:E2) in that order, the code does copy the formula into all the cleared cells as desired.
The "IF" condition is not TRUE when the initial area has more than one cell.
I am quite a novice with excel and I am trying to get a cell to show blank when I select a drop down list value in another cell.
Cell D2 contains a validated list containing two items (Air, Vacuum).
If I select Vacuum I wish to change another cells (D4) contents to blank, D4 is also a validated list containing three items (Yes, No, BLANK) the blank is actually a blank space and not the text blank.
I can get the cell to operate correctly but if I select Air in Cell D2 and then Yes in cell D4, but then change my mind and reset to Vacuum in cell D2 i need the cell D4 to clear its contents automatically.