In excel, which function is similar to INDIRECT? - excel

I have a large number of excel files that I need to use for getting data.
I am looking for a function similar to INDIRECT, in order not to be necessary to have the files open to get the values. Can you help?
Thank you

Consider using ADO..............here is a reference:
Microsoft ADO Reference

In your VBA, you need to first open the workbook:
Workbooks.Open()
Then you can use Workbooks("xxx").Worksheets("").Cells() or Range() [depending on what you want to do].
When you are done taking out the info/data, then you close that worksheet.

You don't really need =INDIRECT() or ADO or even VBA. Just reference the closed worksheet like this in a cell: ='S:\Temp\[T.xls]Sheet1'!$C$4
It will update the values upon opening the workbook; you don't need to have the source workbook open at all. Or you can update them manually by choosing Edit Links from the Data tab in Excel.

Related

How to save Lambda formula as Excel Add-In (or how to easily convert to VBA function?)

I made some very complex Lambda formulas which I use frequently to validate UPC Check digits, and convert UPCs from UPC-E to UPC-A format
I tried to set them up as named ranges, then save the workbook as an Add-In, and followed all the steps I could find to add that add-in into my Excel, however it doesn't look like it keeps the named ranges at all (which is where Lambda formulas are stored)
Is there any way to get around this and still save these Lambda formulas as an Add-in?
I really don't want to have to re-create the entire complex formula in a module, but it seems I may have to do that in order to have the formulas available in every workbook I open
Alternatively, if there's any way within a VBA function for me to use my existing Lambda formula, I would love that, but I'm not sure if that is possible as I know that VBA is a quite different language than Excel's formulas.
I considered making a macro which instead would just add those named ranges to my workbook, but hoping for an easier solution.
Please let me know if you have any tips for this!
What about maintaining a Template,that’s what I do, means they are there in your new books and a quick way to access them for manual copying across to existing workbooks.
2nd idea is use autocorrect to store them with a shortcut word. Autocorrect is application level and there is VBA you can find to copy your AC shortcuts to a backup workbook and reimport them if your PC crashes.

How to copy a cell value from another excel workbook?

Let's say I want to copy Cell C5 from workbook 2 to workbook 1. The name of workbook 2 is a variable given in Cell D1 of workbook 1.
The problem with using Excel's built-in Indirect() function is that the value disappears when workbook 2 is closed. I'm hoping there's a simple VBA macro that can do this.
Thanks in advance.
You seem not to have a lot of experience in Excel VBA, let me give you the general approach for such an exercise:
You can record macros: go to the "Developers" tab, start recording, do the thing you want to do (the copying) and stop the recording. There should be a macro, describing what you have done.
Unfortunately, when doing this, the macro will be something like this:
Source_Range.Copy
Destination_Range.Paste
Generally it is advised to replace this by something like this:
Destination_Range.Value = Source_Range.Value
Good luck and if you have any more problems while doing this, you might ask again by editing your question (I'll be following this question).
The behaviour you're observing isn't a limitation of the INDIRECT() function, but a more general limitation of Excel functions only having access to other workbooks when they're open.
You can use another workbook as a data source by selecting Data > Get Data > From File > From Workbook from the ribbon. Select the source sheet from the Navigator pane, and select Load. This will open the PowerQuery editor.
PowerQuery is an advanced topic which I won't attempt to fully address here, but the default transformation should give you a table containing data from the source worksheet, without relying on that workbook being open in another instance of Excel.

Excel formula without open worksheet

I have one report which is all time updated and changed the file name. I want to know is it possible to make a formula (Except for Mecro code) to another worksheet without open this worksheet.
I am using indirect formula but it required to open worksheet.
Both of these sources indiciate that this cannot be done with a formula alone. However, they propose workaround solutions using vba code, as well as this stackoverflow answer
I strongly recommend to use PowerQuery. Though it uses M language, you can use it with GUI. If your version of Excel is prior than 2013, you must install the addon

How to copy content from a excel table to another worksheet

I have a table (named as Logs) in Sheet1 to which I am writing through a program. I need to copy the content written to the table Logs to Sheet2 as LogReport when I open the workbook. Is it possible to do this without using macros or Power Query option in Excel. I am working with Excel 2010. I have been searching for a while, but I was unable to find a solution which match the requirement.
Looked through the functions available as well, but I was unable to find a possible solution. Appreciate if I can get some help.
"Is it possible to do this without using macros?"
If under "macros" you mean VBA then the answer is No.

Click RefreshWorkbook on Bloomberg Ribbon [duplicate]

This question already has answers here:
Closed 10 years ago.
Possible Duplicate:
How to refresh/load RTD Bloomberg function (BDH) in excel in vba
I am working on an Excel Spreadsheet with VBA. I have a Bloomberg BDH function that I want to refresh from VBA. I tried recording a macro and clicking the Bloomberg->Refresh Workbooks button but the macro came up empty. How can I do this from code? I'm using Excel 2007 and I found one option of entering
Application.Run "blpmain.xla!RefreshAllStaticData"
but blpmain.xla can't be found. I'm not sure what version of Excel/BBG-Addin this was for.
Any help?
What I ended up doing was re-pasting down the bloomberg formulas in the appropriate ranges. This forced the data to redownload. Not the most ideal solution but it works.
Basically, unlike BDP...BDH doesn't refresh because its historical(H), if you want refresh it you need to resubmit your formula.
Maybe not the most elegant solution but what I do is change something in the BDH formula. So you can click on a button you make that takes the data and adds a day and then removes it back. That slight change causes it to refresh.
Another thing I used to do was have a BDH bring in all the historical data, but have the top column a BDP realtime feed so it kept freshing.
In the end, the easiest way is to have the users close the excel sheet at the end of the day and have them reopen it when they need it.
Are you sure you've set a reference to the addin?
Open a code module in the workbook in which you want to use the
Add-In's functions
Go to Tools > References to open the References dialog where you
will see a list of all the libraries and other objects (like
Add-Ins) to which you can set a reference.
Put a tick in the box next to the name and click the OK button.
Source
Once you've done this, you can refer directly to the xla function RefreshAllStaticData.

Resources