Continuous Running If statment that returns entire row

JasonRice

New Member
Joined
Aug 7, 2011
Messages
10
Sorry but I am very new to excel programming. I need to know if the following is possible.

I have 4 different workbooks where each row has 4 columns that describes equipment, issues, possible solutions and if the item is open or closed.

I need to create a master document that lists all the open items on one continuous list.
 

Excel Facts

Did you know Excel offers Filter by Selection?
Add the AutoFilter icon to the Quick Access Toolbar. Select a cell containing Apple, click AutoFilter, and you will get all rows with Apple
If the source files are closed, maybe with a query table?

From a fifth workbook set up a query via ALT-D-D-N and follow the wizard. If you don't have named ranges & see a message about no visible tables, select options then system tables to see the worksheets listed. I'm assuming the data is well structured with headers in row 1 & data immediately under. At the last step of the wizard, take the option to edit in MS Query. Edit the SQL to join the four data sources and apply the criteria. SQL might be like below. This is refreshable like a pivot table - ALT-D-R or via the external data toolbar or right click then refresh.

regards

Code:
SELECT *
FROM `file path`.table1
WHERE status = 'open'
UNION ALL
SELECT *
FROM `file path`.table2
WHERE status = 'open'
UNION ALL
SELECT *
FROM `file path`.table3
WHERE status = 'open'
UNION ALL
SELECT *
FROM `file path`.table4
WHERE status = 'open'
 
Upvote 0
I have been working on this for most of the day and can not figure out how to union together the different files. I can reference them is seperately but then the rows do not update as more are added or taken away.

When I go through the wizard it allows me to select 1 file to open. Then I go to the SQL editor and try to add in the others but I get an error saying SQL entry can not be represented graphically and then could not add table.

This is what my code looks like:

SELECT `' RESL AHU-1 issues log$'`.Issue, `' RESL AHU-1 issues log$'`.`Issue Description`, `' RESL AHU-1 issues log$'`.`Date Identified`, `' RESL AHU-1 issues log$'`.Contr, `' RESL AHU-1 issues log$'`.`Action Taken`, `' RESL AHU-1 issues log$'`.`Issue Status_(Open / Closed)`, `' RESL AHU-1 issues log$'`.`Date Accept`
FROM `' RESL AHU-1 issues log$'` `' RESL AHU-1 issues log$'`
WHERE (`' RESL AHU-1 issues log$'`.`Issue Status_(Open / Closed)`='open')
UNION ALL
SELECT `List$`.Issue, `List$`.`Issue Description`, `List$`.`Date Identified`, `List$`.Contr, `List$`.`Action Taken`, `List$`.`Issue Status_(Open / Closed)`, `List$`.`Date Accept`
FROM `List$` `List$`
WHERE (`List$`.`Issue Status_(Open / Closed)`='open')
 
Upvote 0
Sounds like you're there.

Just acknowledge the message (about not being able to graphically represent etc): it shouldn't stop you doing what you want.
 
Last edited:
Upvote 0
I think it is only that the file path needs to be in the SQL.

Code:
'change
FROM `List$` `List$`
 
'to
FROM `your full file path`.[List$][List$]
 
Upvote 0
I still can't get it to find the file when I put it into the SQL editor. I put it in the format below and it returns that it can't find it. I am using 2007 so maybe it is not possible to join more than one file into a query. I can put multiple queries into the final sheet but this makes it so there are empty rows or overlapping rows.
 
Upvote 0
It is likely just a very minor detail, Jason, that causes it to not work successfully. Suggest you post the SQL that does work.

In case it makes a difference, set up the query from a separate workbook - so that it might give the exact syntax for external file references in the SQL.
 
Upvote 0

Forum statistics

Threads
1,224,520
Messages
6,179,267
Members
452,902
Latest member
Knuddeluff

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top