Excel VBA manual calculations - excel

I want to speed up my macro by using manual calculations until the end, but there's a part where I break links from another workbook. I tried to do this, but it just turned back empty cells instead. Am I not able to use manual calculations when breaking links? Sorry if this question was asked I was having difficulty finding something on it

If you broke a link to an external Excel, you can't retrieve the data anymore. It actualy deletes any formulas. For instance, if you have a 2 Workbooks (Book1 & Book2) with 10 in cell A1 of Book1 and =[Book1]Sheet1!$A$1 in cell A1 of Book2, if you go to Data > Edit Link > Break Link the warning message is quite clear
Breaking links permanently converts formulas and external references to their existing values. Because this cannot be undone, you may want to save a version of this file with a new name.
And then the value in cell A1 of Book2 got converted to 10. Changes in Book1 will not appear in Book2 anymore

Related

The date displayed in an Excel sheet differs from the actual value in that cell

I came across a strange Excel book at work. When I retrieved a date value from any sheet in that Excel book, that value didn't match the date that it is supposed to represent.
However, the value 42978 doesn't represent 9/1/2021, but 8/31/2017. In fact, if you copied that cell to any cell in any sheet in another book, you would see 8/31/2017 in that cell. On the other hand, that value would always go 9/1/2021 in any cell in the original book. As seen, even though the macros have been disabled, I don't know how it can do that. I can't continue to work with that. Can someone please help me?
I would like to upload that Excel book, but probably can't contractually. And all macros in the book are password protected from editing and deletion, so I can't even see the contents of the macros.
There is an option within Excel which makes use of different date-systems: see https://learn.microsoft.com/en-us/office/troubleshoot/excel/1900-and-1904-date-system
Open Excel Options
Goto Advanced
Scroll down to When calculating this workbook and check/uncheck Use 1904 data system
This should fix your problem.

Excel is unfilling calculated cells at random

I have an Excel file on SharePoint.
Multiple people edit said file.
Offline and online.
Excel unfills all calculated cells (VLOOKUP and MATCH) that depend on other sheets in the same workbook at random.
So if you would open or reload that file, suddenly all the cells that use VLOOKUP or MATCH would be blank.
Upon further investigation nobody changed anything or deleted anything.
It just happens randomly.
Now it has happened 2 weeks ago and just today.
I have an interim solution that is to go to a cell with a formula, hit return, then click „overwrite all cells in this column with this formula“ and then click undo to prevent custom cell content to be overwritten.
Everything is back to normal afterwards.
I talked to a colleague, he has the exact same issue also totally at random.
He also encountered this on files that are not being edited by multiple people but himself.
So it is not dependent on the file itself.
Could the language play into this problem?
On some PCs Excel is in English and on some in German.
=IFERROR(IF(ISNA(VLOOKUP(D185,Sheet1!$B$3:$D$616,3,FALSE)),(VLOOKUP(D185,'Sheet2'!$B$3:$D$22200,3,FALSE)),(VLOOKUP(D185,Sheet1!$B$3:$D$616,3,FALSE))),"")
Seems like your sheet isn't calculating upon open. See if this link is of use to you.
https://superuser.com/questions/448376/what-is-the-excel-hotkey-to-re-calculate-all-formula-in-sheet
Also check your program settings and see if auto-calculate sheets is enabled. Don't know from the top of my head where it is located.
Alternative create a small vba function to force recalculate on workbook open.
Getting Excel to refresh data on sheet from within VBA

Locating Lost Excel Macro Formula From Old Data Sheet

I'm resurrecting some old scientific data from the early 2000s.
I need to locate the custom functions that allowed the data to be shown. The spreadsheet that I have is full of #REF! cells, as they are supposed to be calculated based on a custom-defined formula (here, called 'RESECTION').
How do I find this formula? If I can see the math it was performing, I will be able to use this old data, and extend our timeseries significantly.
The spreadsheet is an ".xlsm" document. There is an associated file that is ".XLM"; it provides some GUI-like functionality that is now broken, and I do not see how to access the commands (?) or other VBA that is inside.
I have not had success with this solution.
File with the VBA can be found here; SURVEY.XLM.
Problem is seen here; calling function from SURVEY.XLM. How do I access the formula within here?
I can see that the formula is in there; how do I see the calculation it performs?
RESECTION is a named range refering to cell A4 on the hidden Survey sheet.
In the VBE immediate window type thisworkbook.Sheets(2).visible = true and then thisworkbook.Sheets(2).select.
Cell Survey!A4 contains the value =RESULT(64).
The rest of the sheet contains the macros - first time I've seen or tried to use a filled in macro sheet.
I tried Ctrl+Fto find the definition of RESULT but it comes up with Macro error at cell [SURVEY.XLM]SURVEY!A364.

Will it require me to use VBA if I want to 'copy/paste' data in workbook 2 after being entered into workbook 1?

I have started to build a couple of workbooks that I would like to communicate with each other. My goal is to take entries from column1 # midnight,6am,noon, 6pm, and 11pm in workbook1 and 'copy/paste' them to row1 with the same labels in workbook 2. My main question is do I need VBA for this? My research leads me to believe that I do. However, I know that if I am doing this between spreadsheets in the same workbook I don't. I just use code such as ='Sht1'!A1 on spreadsheet 2 and it will copy and paste that entry from spreadsheet 1, so is there a similar way to do so with workbooks? Thanks for any input!
I figured it out. INDEX function was correct, at least in this instance. The correct formula was not far off because I had my row and column messed up, so the answer was:
=INDEX('[May 2018.xlsm]1st'!$A$13:$D13,1,3)
To break it down for people that do not want to use VBA and struggle with coding like me :)
INDEX() is my function
'[May 2018.xlsm]1st'! is the name of the workbook and sheet that I want to reference and ! means that the workbook is macro-enabled
$A$13 is the beginning of my range (A,13)
$D$13 is the end of my range (D,13)
So my range is 1 row and 4 columns (Think of it like a table), yours could be whatever you want (2x4 or 6x6 or whatever size you need)
1 is the row in the range that I want to reference
3 is the column in the range that I want reference
Be sure to close the function with )
I turned out making this more complicated than it should have been, because I had merged cells and I was technically referencing the right row, but not the right column. I was using (1,2) as my row and column which was referencing my first cell.
Hope this helps.
EDIT: I found later that this only works for referencing static data, so if you use it for a template or another spreadsheet that gets updates, this is not the answer for that situation. I will update again if I figure it out.
EDIT 2: For this to work with a updating spreadsheet, do the following.
=('[June''18 7Q10.xlsm]1st'!$C$13:$D$13)
Its actually much simpler to perform than I originally made it out, but going back to my beginner programming classes I wanted to make sure I understand why it worked not only how to perform it.
The process via LINK is:
Open both workbooks (Source workbook = 1 and Updated = 2)
Find the cell you want to have the data 'Pasted' TO in (2) and edit it with =(.
Now go to (1) and click the cell the that you want to 'Copy' data FROM. This will generate a reference point for you.
Now go back to (2) and finish the function out by closing the argument with ).
Finally, simultaneously press Shift, Control, and Enter and the spreadsheets/workbooks will link, likely leaving you with your result or a 0.0 until data is updated.

Why can't Excel update some of the links in my workbook

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)

Resources