generate a hyperlink in sheet linking to matched data found in a different sheet - vba

I have two different sheets in a workbook with data, all of this data is organized by Site ID's. What I want to do is use these site ID's to create a hyperlink in one of the data sheets that when clicked takes the user to the corresponding Site ID in the other sheet. The sheet name where I want to write the hyperlinks to is called "Report_Manual" and I want to write hyperlinks down every row down the first column. The sheet that I am hyperlinking to is called "Data". The premise Ids are located in column C for sheet "Report_Manual" and column K in sheet "Data". Below is an a ttempt of what I was trying to generate in excel for a single cell formula however the issue I ran into for this formula is that the Premise ID's in sheet "data" are variant data type while the Premise ID's in sheet "Report Manual" are integer data type. This makes even a simple formula like the one below not get any matches as the data types being matched aren't the same.
=HYPERLINK("#"&CELL("address",INDEX(Data!K3:K580001,MATCH(C3,Data!K3:K580001,0))),C3)
If anyone has any idea of a macro to solve this issue that would be extremely helpful.

If the IDs in "Data" are text, try changing your match lookup value to text:
=HYPERLINK("#"&CELL("address",INDEX(Data!K3:K580001,MATCH(TEXT(C3,0),Data!K3:K580001,0))),C3)

Related

Excel VBA - How to copy rows based on a criteria from multiplesheets into one sheet

I've have a spreadsheet with multiple sheets and a need to copy specific rows based on a criteria (a specific month). So the idea is to be able to loop through the other sheets and copy rows (for example all rows with June in column 1) onto the sheet "Consolidated Data" from all the country files without touching the "Do not include" sheet.
Thank you!
You have to be more specific - do all the country pages look the same? How are you indicating the criteria (i.e. June), and what do you want the consolidated data tab to look like?

Look for a word of column 1 and then search that word in another column of another excel sheet and use the adjacent information to fill the cell

I am trying to organize the data into one sheet. I am looking for a way through which I will be able to extract the potential failure mode from 2nd sheet to the first sheet. The key point is that the potential failure mode should match with its respective component. So the list of components is mentioned. A way through which Potential failure modes of that respective component is detected in another excel sheet and the information which is available in the adjacent column to be extracted on the first sheet.
Your problem is going to be solved with the function =VLOOKUP
Since you are hiding your column and sheet names, I am making some assumptions (assuming the first pic is called Sheet2 PAF is on column B and PFM is on column C). Try on Sheet1!D3 the following formula
=VLOOKUP(A3,Sheet2!B:C,2)
and it will fill in the FPM if a match of Sheet1!A3 is found in Sheet2!B column. You may want further reference
https://support.office.com/en-us/article/vlookup-function-0bbc8083-26fe-4963-8ab8-93a18ad188a1

Excel drop down list to convert full name & enter Abbreviations

I have a database called Overtime with a second sheet called data. On the first sheet I am using data validation to access the data list on the data page. At present The list has peoples full names. What I want to do is when a name is selected it then changes it to the Initials from the Data sheet. Not sure if this can be done into the one cell, or to use something like Vlookup to enter the initials into an adjacent cell. The names and Initials are on the same rows on the data page (in columns "I" & "J"). On the main database the validation list is for column "O". I have a column "P" ready to put in the formula to show the initials if this the only way it can be done.
With data in the Data sheet like:
In P1 enter:
=IF(OR(O1="",NOT(ISNUMBER(MATCH(O1,Data!I:I,0)))),"",VLOOKUP(O1,Data!I:J,2,FALSE))
and copy down.

Excel - Can not compare two spreadsheets

I have gone through V-look-up guides online but I can not find one that explains what I am looking for. I am trying to avoid manual checking.
What I have:
Two sheets, Sheet 1 and Sheet 2. Both sheets have the same column names (A1:G1) with multiple rows.
Sheet 1 contains my spreadsheet where I update daily. Sheet 2 is the same spreadsheet that is imported from a application (but has hourly updates). Data can change in each row (for some columns) along with additional added/deleted rows. The data is text, dates and numbers (mixture of both too).
I want to run a formula to highlight the changes on sheet 1 (grabbing the updates from sheet 2. Once I find out the formula works correctly, I would like to know how to replace the Sheet 2 updates onto my spreadsheet (Sheet 1).
I am looking for a formula outside of creating a macro (worst case scenario).
Currently I have the following vlook up formula:
=VLOOKUP(A1,sheet2!$A:$A,1,FALSE)
When I run this in another column (lets say in H1 in Sheet 1), it will display "N/A" if that column (A1) in Sheet 2 is not the same. If it is the same, it will write out the column name.
When I use the following formula highlighting all the cells in Sheet 1, I get a values error:
=VLOOKUP(A1:G33,Sheet2!$A:$G,1,FALSE)
How could I apply that formula to the whole spreadsheet (I guess it would apply to both sheets) and have it highlight records in my spreadsheet (Sheet1). Could it also highlight rows that are missing or added?
The data in Column 1 and 2 would never change (they are ticket numbers). Only change that can apply is if ticket is closed, so when I import the updated spreadsheet that row isn't there anymore. If you think there might be a better way to tackle this down, I would like to hear.
Please let me know if I am not clear.
Here are some example screenshots:
Just in case, the formula for the totals are (adjusting the columns for each):
=SUBTOTAL(3,INDEX(C:C,2):INDEX(C:C,ROW()-1))
Sheet 2 is setup very similar. When I import it into excel, the columns are the exact same as Sheet 1, the only difference can be more/less rows (along with the updates for each row).
You can use conditional formatting.

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.