Getting Reference (url link) from another cell? - excel

I want to link a cell to an external file. The name of the external file changes daily though.
I created a cell that contains the full address of the external file (C:\Users\Main\Desktop\data\History\02092013.csv)
I then named that cell HistoryFileReference
So then why does this not work?
='HistoryFileReference'!$A$2
When I press enter, a window named "Update Values: HistoryFileReference" pops up, asking me to choose a file.
edit: I don't want to "update links" via excel. Thanks

For this to work you will have to manually put brackets in the file name and then store it as
C:\Users\Main\Desktop\data\History\[02092013.csv] in the cell which you have named as HistoryFileReference
Now open the CSV file and leave it open. Go back to the above sheet and type this formula
=INDIRECT("'" & HistoryFileReference & "02092013'!$A$2")
and press Enter and you are done :)
Caution: Next time you open the file, do not click on Update Links else all the values generated by the above formula will change into #REF! as Indirect doesn't work with close files.
For the sake of an example, I have place a csv file in C:\ as shown in the screenshot below and I am trying to retrieve values from Cell A1

Related

Excel, use file path to reference cell values in another workbook

I have a series of daily spreadsheets which are file by:
year / month / date
e.g.
/Users/myles/Dropbox (Green)/05_GM Vessels/Crew Dropbox/Green Isle/02_Daily Logs/2019 Logs/[GI_Daily_Log_30.07.2019.xlsx]Sheet1'!$B$44
I would like to use a formula to extract the value within the specified cell (B44 in this case) and show it in a master / summary spreadsheet.
The files are in a different directory to the master / summary spreadsheet.
I have a formula which generates the above file path based on values in other cells. E.G. ="["&$D$14&$W5&"/"&$A5&"]Sheet1'!$C$24"
Which creates the following text within a cell;
[/Users/mylesmetson/Dropbox (Green Marine)/05_GM Vessels/Crew Dropbox/Green Isle/02_Daily Logs/2019 Logs/7_July/[GI_Daily_Log_29.07.2019.xlsm]Sheet1'!$C$24
Ideally I would like to remove the first / and then insert " =' " which if pasted as text into a cell, would then extract the value from this spreadsheet file and the referenced cell. But this does not work. instead I am having to do this manually in notepad and then copy & paste the entire text back into the cell.
Finally prior to excel retrieving the number in the referenced cell, I have to give permission / find the file location.
This is quite a complicated thing to explain and I have not found any other solutions on the internet which are 100% relevant to this scenario. I think a macro may be required, but hopefully this can be done elsewise.
The indirect macro, would be ideal, apart from it requires the spreadsheets to be open, which is simply not practical either.
Thanks
for any help which can be provided.
Myles

hyperlinks to PDF files

I have an Excel spreadsheet in which I need to make hundreds of links to PDF files that are in the same folder on my computer.
The file name for the link appears in the Excel table.
Today I create each link separately, but I'm sure there is a simpler way to tell Excel to copy the link in the top box but look for the file whose name appears in the Excel table.
I'm doing each hyperlink separably
Assuming A1 has the name of the hyperlink and A2 has the location, use this formula where you want the link to appear:
=HYPERLINK(A1,A2)
You can then copy this down to the other cells.

Formula information displaying correctly, but link information is not

In the picture above I have placed the following formula in cell J1:
=HYPERLINK(LEFT(CELL("filename",A1),FIND("[",CELL("filename",A1))-1),LEFT(CELL("filename",A1),FIND("[",CELL("filename",A1))-1))
I originally created the file on my local C: drive and personal download folder. I then created hyper link formulas in I4, and copied down, that build on the path name J1. This worked fine and dandy when I tested it.
PROBLEM
When I move the file to the network drive, the value in cell J1 showed the new new network path. However when I click on the link it would open my personal download folder where I originally created and saved the workbook.
What I have tried
I thought there might be some value saved some where that was not updated when I moved the file since I used explorer to move the file as opposed to saving the open workbook in a new location. To over come that I tried saving the file in its new location with no effect. I also tried save as with no effect either.
What I was trying to achieve
I was trying to achieve an automatic link that would allow the user to click on the drawing link and it would open the associated file independent of how they have mapped or reference the network location. It would also automatically update the path should the folder be moved or renamed.
What went wrong? is there a better way of doing this?
Potential Cause
When using the =HYPERLINK formula, excel also generates a hyperlink as if you added one manually by right clicking on the cell. It then also formats the text with an underline and blue/purple text. This "manually" created hyperlink sits on top of the formula so it gets selected first. It is this "manual" hyperlink that does not update.
Work Around
Select all cells with the issue. Right click to bring up the menu and then select remove hyperlink. This removes excels "Manual" hyperlink, but leaves the cells hyperlink formula which still works and is updated.

Bookmark Special Paste, Excel look in same folder

I have a word doc and an excel doc, I have created bookmarks in word and special pasted into excel.....These bookmarks works AS LONG as the files stay in the ORIGINAL location (example- C:\Documents and Settings\My Documents\New Form)
BUT
I need to move the documents to different client locations (example- C:\Documents and Settings\My Documents\client1)
In excel the cell information reads like this;
=Word.Document.8|'C:\Documents and Settings\My Documents\NewForm\TestFactFind.doc'!'!Title'
Is there anything I can put so the excel file will look into its current folder to find the word document instead of a set location?
NON VBA Method
Yes it is possible for the Excel formula to pick up the value from a file from the same directory where the formula containing files reside. You have to use INDIRECT(). However a word of caution. INDIRECT will work only if the destination workbook is open.
Here is an example
Let's say the formula in Cell B1 in C:\Book1.xlsx is
='C:\Sample\[Sample.xls]Sheet1'!$A$1
Then put this formula in Cell C1 for testing it
=INDIRECT("'" & LEFT(CELL("filename",A1),FIND("[",CELL("filename",$A$1))-1)&"[Sample.xls]Sheet1'!$A$1")
Screenshot
I dont know about Word bookmarks, but I assume they are the same as Excel hyperlinks (?)
This may or may not be relevant in Word, but in excel you can create a link to any other document using the hyperlink formula. If you use the current directory (folder) as the root, it will go from there.
".\" is the current folder
"..\" is the parent folder that the current folder is in
So lets say you have an excel sheet with links to 20 Word documents stored in a subfolder called REPORTS (excel to word being the reverse of what you proposed, but it is probably the same the other way around?).
The links in each excel cell would be:
=HYPERLINK(".\REPORTS\JAN.DOC","January report")
=HYPERLINK(".\REPORTS\FEB.DOC","February report")
=HYPERLINK(".\REPORTS\MAR.DOC","March report")
etc...
A feature I use often is to have the filenames, or part of the filenames, listed in an excel column parellel to the links, and use that cell in the hyperlink filename. Take the following example, and assume it to be range A1:B4 (Line 1 being the column headers "month number" and "link to report").
In this example, I named my word documents MONTHxx.DOC, xx being the month number.
MONTH NUMBER LINK TO REPORT
01 =HYPERLINK(".\REPORTS\MONTH" & A2 & ".DOC","Report for month " & A2)
02 =HYPERLINK(".\REPORTS\MONTH" & A3 & ".DOC","Report for month " & A3)
03 =HYPERLINK(".\REPORTS\MONTH" & A4 & ".DOC","Report for month " & A4)
etc
Having the cell at the end in the second part of the hyperlink puts the month number also in the name of the link for the user to see. You can, of course, use any cell there to put a name.
The beauty of this method is that if you have, say, a list of 500 files to link to, and they are all numbered in sequence (like the example), you can just copy-paste the first hyperlink all the way down the column which will instantly give you 500 links to other documents.
Just FYI, the documents do not need to be open already. Clicking the link will open the linked document.
I know this is not what you asked about, but it is fairly close. Hope it helped.

EXCEL Formula not auto updating! Help!

I have an excel formula to pull the name of the file in excel and put it into a field. The problem is, when I open multiple files I've already done, it repulls the file name and updates it to the LAST file opened. So if I opened MFULTON and then JADAM, the file name cell for JADAM would real MFULTON. If I manually double click and press enter, it will auto correct back to JADAM, but my colleagues won't know how to do this. What is happening?
Uou need to make your formula Volatile
You can try this. Go to File->options->Formulas-> Workbook Calculation-> Select Automatic. And also Check the check box Formula Auto Complete.

Resources