Google Sheets Pulling Info From Different Files - spreadsheet

I have two unrelated sheets. One sheet is what holds a backlog of names, dates, and locations. The other sheet is an authentication sheet where a sticker number is assigned to one of the names one the first sheet. I can't combine the two in one sheet and have two tabs because I need to import the second sheet everyday and it can't have another tab added in.
I want to be able to have the second sheet 'scan' the first sheet file and pull information automatically. So if sticker 001 has Bob Jones, the code scans the manifest for his 'location' and 'date' and then automatically fills sticker 001.
I have no idea how to write code so I'm just curious if it's possible to grab informatoin from a different file or if both tabs need to be under one sheet.

Related

Excel, how can I link multiple spreadsheets to cells with changing values?

I have a bit of a situation that I can't seem to be able to resolve. I'm currently using excel to keep track and sort 50 patients at the same time for research purposes. So in my main worksheet, A1:A50 are the patient's "station number" and B1:B50 are the patient's names. Columns "C" through "I" contain information about each patient (sex, gender, ecc.). I keep the patients sorted by their station number.
I then have a different worksheet for every patient in which I keep track of each patient's blood tests during time.
I'm trying to find a way so that I can click on a certain patient and get re-directed to his/hers bloodtest worksheet. And I've done so with hyperlinks. The problem is that patients constantly change, as do their station numbers.
For example, patient John Doe has "station number" 001, so he is on the top of my list. His station might change the week after to 005, so I manually copy/paste his info in row 5. This way, every time I cancel a patient I lose the hyperlink and need to manually search for the worksheet and re-link it to the new patient.
Is there any way in which I can lock a hyperlink to a cell regardless whether or not it is empty? This way I could move patients up and down my chart & change cell values without worrying about messing up the hyperlinks.
I also tried to create a chart with 50 rows in which every time I changed a station number a macro would then sort all the rows. It turned out to be a dead end as I was able only to get the macro to copy/paste the patient's info into the correct row instead of it replacing the row.
Any ideas?
The link below probably has the simplest solution I have seen for creating dynamic hyperlinks based on changing cells.
https://www.extendoffice.com/documents/excel/4030-excel-dynamic-hyperlink-to-another-sheet.html
Also, see this link.
https://excelribbon.tips.net/T013034_Creating_a_Dynamic_Hyperlink.html
Finally, consider this...create a hyperlink that is dynamically linked to a cell value, in which the cell value points to a cell reference within a worksheet, and that when the value is changed can point to a different cell reference.
=HYPERLINK("#Sheet2!A"&Z1)

Excel: Creating a dropdown using two different ranges

I have following threes excel sheets in a single workbook:
Range1_Sheet (A1:A5 contains the data that need to be displayed in
drop-down)
Range2_Sheet (A1:A5 contains the data that need to be
displayed in drop-down)
List_Sheet (This sheet shows a drop-down containing all values that lie in above two ranges).
I successfully did this using one range/sheet. But i was wondering how list can be populated from two different sources?
Here's the same question but only an answer for Google Spreadsheet Can I create a drop down list with data from multiple sheets
Try this - Data Validation:
http://www.contextures.com/xlDataVal05.html
Maybe this?
http://ccm.net/faq/15543-excel-creation-of-dropdown-from-dynamic-list-in-vba
It explains the way with 2 different workbooks but should work with just one workbook and multiple Sheets, too.

Copying a worksheet in Excel 2013 using VBA to the end of the workbook

I am working in Excel 2013 and am having some trouble. I have researched online all day and can't seem to find anything that solves my problem.
I have an Excel document that consists of 6 sheets:
Format
Summary
1.1 Detail
1.2 Detail
1.3 Detail
1.4 Detail
The 'detail' sheets are formatted all the same. The 'Summary' sheet rolls up all the values from the 'details' sheets and has all kinds of charts and useful information in it. The 'format' sheet is what I created to try to make this document more dynamic and useful for all different kinds of projects. This document is being used for estimating projects, so different projects are going to have different amounts of 'details' sheets.
SO, my goal is to have a blank in the 'format' sheet that asks how many details are needed. When the user types in 5, the code will add a sheet named '1.5 Detail' to the end of the workbook and have it formatted the same as the other 'details' sheets. Is this possible using VBA? Also, is there a way to make the charts and formulas include the new tab when it is added without manually going and adding it to everything?
Thanks in advance!
Let's say you had three detail worksheets named: d_1, d_2, and d_3.
Each has an Excel Table named Labor with a column entitled "Cost". Each Labor table has a unique number of data rows.
On a summary sheet you could sum all of them like so:
=SUM(d_1:d_3!Labor[Cost])
The above will give you the labor cost grand total from all sheets. It is summing all of the rows from the tables and is not dependent on any summary information in the detail sheets.
So if you add a new detail sheet, d_4, then yes the example formula would need to be updated. HOWEVER, there is an old trick to get around this...
Create two additional sheets with the same tables, but with only one row of ZERO values in each table. Call the first one of these sheets "START". Call the second one of these sheets "END". Place START immediately before the first detail sheet, and place END immediately after the last detail sheet. NOW MAKE BOTH INVISIBLE.
Finally change the example formula to:
=SUM(START:END!Labor[Cost])
Now when new detail sheets are added, d_4, d_5, d_6, d_n, no change needs to happen to the formula on the summary sheet, yet all of the new data are included in the summary calculation.
Use ThisWorkbook.Worksheets.Count to count the number of sheets. Then if it is less, use Worksheets.Add and ActiveSheet.Move After:=Sheets(ActiveWorkbook.Sheets.Count) to add it on to the end.

Splitting data between worksheets depending on status of Column A

I have been asked to create a database of volunteers in Excel. The main worksheet (called Data) holds all the information – names, addresses, numbers, reference checks, placements, supervisors, etc. What I am trying to achieve is for the relevant information to be moved from one worksheet to another when the status of the person changes.
There would be 5 categories which the volunteers would fall under (column A labelled ‘Status’)
PROCESSING
ACTIVE
ON HOLD
BARRED
STOPPED/RETIRED
What I want to get is a live database so the information would appear on a relevant worksheet whenever the status on the main spreadsheet changes , but I only want some information to show depending on the category…
Each Worksheet would contain columns A-F from the ‘Data’ worksheet and in addition:
Processing would contain columns X-AE
Active: AF-AW
On Hold: AZ-BC
Barred: AX-AY
Stopped/Retired:- BD-BH
I have searched and searched again but I know nothing about Macros (and my IT department is unable to help) So my question is – is this doable and if so is anyone able to help me?
I hope I am making sense and if not I can email across the dummy database with some made up names to show what it is I am trying to create
You can do this using array formulae. This link shows a simple example which provides the basic formula (explained in detail in the linked article)
=INDEX(range,SMALL(IF(col=value,ROW(range)),ROW(1:1)),COLUMN(A2))
Where range is the range of all your data from your main worksheet and value is the value you want to screen for (this changes for each of your sheets) and col is the column on your main sheet that you want to check the values of. Note it is an array forumla so you have to press control+shift+enter after typing in the formula as explained at the bottom of the link.
You will notice that I have changed the formula to say COLUMN(A2) instead of 2. This is so that you can drag the formula across the columns as well as down the rows. You might need to make this COLUMN(A2)-x where x is an offset because your data don't start in column A.
Note that the same applies for the ROW(1:1) part, if your range doesn't start in row 1 then you will need to offset this by some value as well (i.e. something like ROW(1:1)-y)

Alternative to Excel INDIRECT that works on closed files, and links to workbook based on cell value?

I've seen many questions on this forum about linking Excel files based on cell values and INDIRECT always pops up as an answer, and it does do function and fill my sheet the way that I want, but I need to find a way to work with the source file being closed. My problem when it comes to linking, is that the file path to pull the data from will not be known until part of the file name is entered into a cell.
For example, in 'Print Summary' workbook, Sheet1 Cell A2 is where the file name is entered as a number 12345 (and gets auto-formatted to place 'WIP' in front) which represents WIP12345.xls. WIP12345.xls is a form that holds information that needs to populate certain columns across row 2. WIP12345.xls is an order form and completed days ahead. Once it has been approved, the summary workbook is updated with the WIP#.
I did CONCATENATE WIP12345 and .xls to create the file name WIP12345.xls on Sheet2, and I have a Macro that copies and pastes special as value to turn the result into text. But, I can't find a way to create a formula that will take this value and lookup the file to pull information from. I need to pull and fill information from different cells to 10 columns down 43 rows (each row representing a different WIP#####.xls file).
I'm guessing VBA is the only way to go, but I have no idea how to write it. Anyone have a direction they can point me in? I hope I'm coming across clearly.
The free add-in morefunc.xll contains a function called Indirect.Ext, which works with closed worbooks.