I thought it is going to be quick to what I plan to do but it is getting me no where.
I have a huge excel file with various tabs (i.e worksheets).
The main worksheet (the first tab) is named Inventory. I got a modified version of Inventory worksheet which has lot of changes. So I copied this as 'NewInventory' into the excel file.
I have lot of formulas with lookups pointing to Inventory but I need all of them to reference now to NewInventory.
I can't rename Inventory as InventoryOLD as the references gets changed.
Is there a way I can have all lookup formuals (there are plenty in sheets such as Sh2, Sh3, Sh4 etc) to look at NewInventory instead of Inventory in some simple steps.
Here is an example formula
=VLOOKUP(A2, 'Inventory'!$R$2:$R164104, 1, FALSE)
I don't want to change for one cell and then drag it all the way down and repeat for other cells across various worksheets.
Please suggest.
Head into Replace (+H), expand
Enter "Inventory" in the "Find What" field.
Enter "NewInventory" in the "Replace with" field.
Change "Within" option to "Workbook".
Click "Find All".
Nothing's changes yet, however you can browse down there and see if that nailed everything. If it did .. Replace All.
Viola . done.
I've used this to exactly what you've done in the past, works like a charm. Good luck!
Related
I am really new to VBA. SO this might seem a silly question for experts.
after researching the internet on how to put dynamic range for filters in excel considering a situation when your list might grow or shrink I stumbled on couple of ways. One of them is as the following.
ActiveSheet.Range("A1").AutoFilter Field:=46, Criteria1:="1"
I know the you can put two arguments to specify ranges and the second one is optional. In this particular I am just putting the first cell where my data starts. My questions are below:
does the code automatically select the active range based on the first specified cell?
Had my data started from "C5" would i still have to chose the argument as "A1"?
I am filtering out something from column 46. what does it matter where I specify my first cell? for example if I had chosen "C5" instead of "A1" how it would have affected my macro?
Let's say, I want to filter out something from column 2 ie, Field 2. But the argument for range I choose as "D5". How it would affect my macro code?
AutoFilter: A Small Study
Well, I was curious, too. So I studied it a little bit and created a
workbook where you can input the parameters of some of the arguments
of the AutoFilter method and just by clicking on a command button
apply the changes. The next click removes the filter.
The workbook also contains the results of the behavior when changing
by row. The same thing could be done by column.
Workbook
Download
(Dropbox)
The following image displays the initial state of the only worksheet in the workbook.
This I was most curious about: what would happen if I would filter in C8. There's a surprise.
There still remains a ton of unanswered questions, but this could get you started to investigate deeper.
I have a very large spreadsheet with lots of worksheets that I use to create invoices based on a project number. Each project doesn't get billed on a monthly basis. I have to print each invoice to PDF and to avoid having to open every tab to see if there is information to bill, I'd like to change the tab color based a cell which contains the total of the invoice.
I have used VBA very little but have found several macros that are trying to do the same thing but because they rely on something different, I can't get what I need. I found one that just turns all the tabs a color. I found one that changes the color based on a true/false formula. I don't have the knowledge around this code to change it so that if cell H22 is >0, it turns the tab a color.
The invoices created before I took my role aren't consistent so not all totals will be in cell H22 -- it could be H14. I'm even willing to put a button on each tab that I could press to apply the macro as I do my preliminary work on each tab. I just don't have the knowledge good enough to know how to write the code. Thanks!
The easiest way would be to find an cell that none of the worksheets use (say AZ99) and do the equivalent of the H22>0 example you described on each sheet.
e.g sheet1 might have AZ99 as X10>0, sheet2 might be Y11>0 or whatever.
Use the true/false VBA code to look at cell AZ99 or whatever the cell you choose is.
I have a Master workbook in MS Excel that references data in 4 other workbooks.
When it opens I get the following message:
We can't update some of the links in your workbook right now.
You can continue without updating their values, or edit the links you think are wrong.
[Continue] [Edit Links...]
Each referenced workbook contains a N row, 365 column rectangular range that I have named 'DataRange'
My master workbook contains 4 lots of N row, 365 column ranges with Array Formula linked to these named ranges:
{='C:\Path\[Workbook1Name.xlsx]Sheet'![DataRange]}
It feels like i've come across an Excel bug.. Anyone know what I'm doing wrong?
Are you using MS Excel 2013, when you receive this error?
If so, it maybe due to the "3D reference in your named DataRange" in Excel 2013 or because you're referencing a range or cell in a closed workbook.
Excel allows the defining of names that refer to specific cells or ranges of cells in that workbook, similarly (using the Define Name tool in the Formulas tab) you can assign a formula to a name and then use that name in place of the formula.
The named formula or named data range is part of a collection in that workbook's (workbook1) objects and can be used in different workbook (workbook2), but the link to the defined name in the other workbook must be done one of two ways.
Link the defined name with a formula like this
='C:\Folder\Path\Workbook1.xls'!NamedFormula or NamedDataRange
Or Create a defined name in workbook2 (it can have the same defined name as workbook1's or a new name) and then refer workbook2's defined name to workbook1's defined name. Select Define Name on the Formula tab and copy a link like this in the Refers To Field:
='C:\Folder\Path\Workbook1.xls'!NamedFormula or NamedDataRange
Note these links will only work when being used in simple formulas which treat the link as a direct links. It will not work with more complex formulas when the original workbook (workbook1) is closed because the link is often treated as an indirect link in complicated formulas.
To work around this issue, use either of the following methods:
Save workbook1 and workbook2 as .xlsb files.
Do not add an external reference link to a defined name that refers to a 3D reference or named range.
Or open both workbooks
For more detail information, please refer to the following link:
https://support.microsoft.com/en-us/kb/2755120
If you're still receiving an error/ warning message after trying all my above suggestion. You might want to some troubleshooting.
Try this:
- Open Excel. Under Tools->Options->Calculation, select the Update remote
references box.
Open your workbook. Make sure the box the remote reference box is checked. Save your workbook this way after updating the link. Close workbook and Excel.Restart Excel and open your workbook.
- Look under defined names and delete all that you don't need or that have broken formulae. Run a FindLink search, to pin point the problem.
This process worked for one of workmates with this exact problem.
I hope this helps, if not let me know. There might be a 4th solution.
I finally solved this issue after going on a scavenger hunt. In my case, the reference was to an old file that no longer exists, and removing the reference was all that was needed. Unfortunately Excel does not pinpoint where the reference is, so it was a pain to look for the cell that was making the reference.
In my workbook, it was a reference as a part of a Data Validation. For others seeing the same error, I recommend using the Find & Select -> Go To Special feature (Home ribbon tab) then searching by Formula errors and and Data validation.
Open Excel
Go to "Inquire" tab page in the ribbon
Select "Workbook Analysis"
Check Items\Cells\With Validation Criteria items. In the "Validation Text" you might spot references to the extenal source.
The "Cell Address" column would give you the list of problematic cells.
Look around any other supsicious findings of the Workbook Analysis tool
Have you considered giving the data ranges different names? DataRange1, DataRange2 etc, or is this not possible due to other constraints. When excel says "some" of the links, how far has it got?
I got it working by ditching the FormulaArray and set the FormulaR1C1 for the entire range. Unfortunately the formula was a bit more complicated.
=INDEX(
'C:\Path\Workbook1Name.xlsx'!DataRange,
ROW() - ROW(Workbook1DataRange) + ROW('C:\Path\Workbook1Name.xlsx'!DataRange) - 5,
COLUMN() - COLUMN('C:\Path\Workbook1Name.xlsx'!DataRange) + 1)
I'm having trouble with a cross-sheet reference within the same file.
On the second tab named "Disclosures & Identification," there is a set of merged cells at D5:G5 which hold text.
On the first tab, there is a reference to that cell. The formula being used is
"='Disclosures & Identification'!D5. Instead of copying the text from the second tab's field, the formula just appears in the cell.
I have tried renaming the tab (in case the & was the problem); I have tried using the entire set of merged cells in the reference (d5:g5); I have saved the file under a new name and updated to Office 2007 format (old version was 2003, but that should have worked anyway); and I have done what I consider an appropriate amount of searching for the answer (with no luck). Does anyone have an idea as to why this might not be working?
There are 2 possible things:
Make sure the format of the cell is not 'Text'. If it is, change to something else, such as 'General' and then double click in the formula bar and press enter.
Make sure that 'Show Formulas' is OFF. You can find the option under the tab 'Formulas'. Otherwise, you can use Ctrl+`
In case the above doesn't work, ensure your list isn't filtered or the filter is set active. Deactivate the filter and try link again.
Does anyone know of a pre-packaged solution for referencing Excel cells directly in a Word document?
For example,
{[TestExcel]Tab1!A1}
Dear Mr. {[TestExcel]Tab1!A2},
Our systems have alerted us that your account {TestExcel]Tab1!AccountNumber} is overdue. Please remit payment of {TestExcel]Tab1!PaymentDue} immediately.
This example uses a hypothetical { } syntax, where the contents are standard Excel formula.
Every solution I've seen uses custom VBA to accomplish this. It seems like an extremely common need for which there should be some good 3rd party software available that lets non-technical users accomplish this task.
As indicated in the example above both named ranges and standard cell references would need to be supported.
Yes.
Step 1: Copy the excel cell.
Step 2: Go to your word document where you want to paste the reference.
Step 3: Right click
Step 4: Under paste options, select "link with source formatting" or "link and merge formatting".
I tried #Green Demon's method, but the two Paste Options listed were not present for me (Office 2013). I only had Keep Source Formatting, Merge Formatting, and Keep Text Only. However, I poked around and found the Paste Special, which was hidden on the Ribbon
The instructions are as follows:
Copy the Excel range.
Go to your Word document, and left click where you want to paste the Excel range.
Click on Paste Special from the Ribbon as shown below, or type Ctrl+Alt+V.
Click on the Paste link radio button.
Click on Microsoft Excel Worksheet Object. The Paste Special dialog box should look something like this:
Click OK.
The range should now be pasted in your document, and if you save, close, and re-open the Word document, you will be prompted about whether or not you want to "update this document with the data from the linked files," which works the same way as it does if you're doing Excel-to-Excel linking.
This feature is fantastic, and I'm so happy to have found it today. However, in my brief experience using it, having these Word-to-Excel links dramatically increases the amount of time it takes to open your Word document, even before it prompts you about updating. After that, the act of updating the Excel links takes much longer than it would if you were doing the same linking Excel-to-Excel. All of my work is done on network-share files, so YMMV.
While Will's solution indeed links from the Cell objet, the content is inserted as a picture.
In the same dialog, selecting "Unformatted Unicode Text" instead will link and insert only the cell's content, which is desirable if you apply custom formatting on your text.
Unfortunately, this action only works for a single cell. Copying multiple cells will result in a text block with individual cell content seperated by tabs or line skip, with the entire block considered linked and entire. The solution is to link individual cells using this method.
This can become tedious if you plan on linking large portions of table from Excel, as for every cell the dialog must be invoked. It can be sped up by using hotkeys, but the sequence gets tedious:
alt,h,v,s, then alt+l, tab, ↓, and finally Enter
Obviously this is not practial for large numbers of cells. A AutoHotkey script can help but it third party grafted solution, on par with using VBA scripts.
alt+h+v+l works too. If you're building big documents clicking the ribbon every time gets murderous after a while.
As this is still a problem but the other answers do not take into account the latest development in word, there is a new solution, editing Green Demons answer:
Step 1: Copy the excel cell.
Step 2: Go to your word document where you want to paste the reference.
Step 3: go to the "home" tab
Step 4: Under paste options, go to "Paste Special", click on "paste link", click on "Unformatted Text".
This solves the issue others were having with the new lines that you would otherwise have with just Green Demons' solution.
Hope this still helps others.