Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Have a spreadsheet generated by idiots in Payroll.
ALL COLUMNS ARE FIXED, NOTHING CAN BE ALTERED IN TERMS OF WHERE DATA (FIELDS) FROM QUERY CAN BE POSITIONED. Someone in HR enters data by hand into the spreadsheet starting in Cell A10 to Column BW Row ??? - depends upon how many new hires/fires previous reporting period. Could be two rows of data, could be 22 rows of data Have created three Access queries that return data to the spreadsheet through MS Query (Excel 2000). Query 1 starts in Cell A10, Query 2 in Cell A20, and Query 3 in Cell A30. Data is refreshed automatically every time spreadsheet is opened, no need for HR morons to do anything but open the spreadsheet, review the data, send it along to Payroll, go back to playing Solitaire. Ideal setup for any HR person. However, the deal with the number of rows being dynamic in nature means sometimes the new hires query returns five rows, (qry 1) terminated employees query returns three rows (qry 2) and changes in Title query could be ten rows (qry3). Sometimes it's the inverse. I need query 1 to ALWAYS return data starting in cell A10. OK fine, got that. But if there are only two new hires, and query 2 is set to return the first row of data starting at cell A20, that means eight blank rows, and that's bad. Each query is a "not matching" query with different sources, so I can't combine the three queries into one. When the spreadsheet is sent back to payroll, there can't be any blank rows. OF COURSE, HR person could sort the spreadsheet, thereby deleting blank rows, but that would take common sense, which is in short supply up there. Is there any way to create some kind of array/vlookup that says? "Query 1 has found seven new hires this reporting period, returned seven rows of data, Query 2 begins eight rows (cell A17) from where query 1 started in cell A10, and query 3 starts the next row directly below the last row returned in query 2" Is that possible? Without any involvement from end-user? I would prefer not to use macros. Anyting in VBA is fine. |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Help: Creating dynamic sql queries in excel | Excel Programming | |||
dynamic web queries with vba | Excel Programming | |||
Form placement on spreadsheet | Excel Programming | |||
Dynamic Web Queries | Excel Programming | |||
Dynamic Web Queries | Excel Programming |