Hi everyone,
New to the forum, it is also the first time that I use excel for professional reasons (excel 2003). Here is my problem, help would be highly appreciated.
I am currently carrying on a mapping of all development projects in an country. For that purpose, I build a simple excel database with these projects and information about them (name, sectors, location, amounts, dates, etc..).
My problem comes from the fact that projects have to be filled up by financing organizations themselves. I can only check the data after them. Thus, I would like my database to have a dedicated sheet for every organization, in order to avoid that they change/delete/create data of other organizations. That why I created several identical sheets for every organization (say X/Y/Z/...)
But of course, the final need is to have a master compilation spreadsheet with all projects together (called "ALL Projects"). And I would like this spreadsheet to be filled up and updated automatically when changes are done and projects added by organizations in their sheet.
So I thought about displaying a succession of several dynamic named ranges (called "X_Projects", Y_Projects", etc...) into the master spreadsheet.
But this raises two questions:
- To create these dynamic ranges, I used INSERT-NAME-DEFINE and used the code OFFSET with COUNTA (detailed in the example database in the X sheet). Is this code really working for big ranges including numbers, text, but also dates and list selection?
- If yes, then how to display these defined dynamic ranges following each other in the master spreadsheet, for it to be automatically updated. Again, data to be displayed are the same for every project.
- If no, would you have any other suggestion for me? I looked for this for hours, and am completely stuck. Links to tutorials or other posts are welcomed too.
Please find enclosed a light example of my database, to better understand what I mean. example.xls
Thank you very much guys!
Best regards
Hi,
It's always good practice to use dynamic range names and I'm a great fan, but they are probably not necessary here.
Are all the individual sheets always the same layout, i.e. like columns in the same position, and are all the project names fixed without users ever inserting or deleting rows? Remember you can always unlock those cells in which you want users to enter data and then protect the sheet with a password which will then prevent changes. If so then the simplest way is just to link the summary sheet cells directly to the individual sheets.
If not then perhaps a better way would be to have a macro which cycled through all the sheets and built the master table for you by copying each individual sheet in turn and stacking them underneath each other on the summary sheet
If you allow users to enter new rows or move rows about then alternatively a non VBA solution would be to use the following formula on the summary sheet in B2 and copied down and across
You'll need to copy across first, then reset the formatting then copy B2:E2 down. Then all you need to know is how many X,Y,Z etc. rows to include on the summary sheet.=INDIRECT("'"&$A2&"'!"&CHAR(64+COLUMN(B2))&ROW())
Does this give you some ideas?
Richard Buttrey
If this was useful then please rate it appropriately.
Click the small star iconat the bottom left of my post.
Dear Richard,
Thank you for your time. This is for sure a first step.
Indeed, all the individual sheets will have always the same layout for every organization (i.e. columns in the same position). The aim of this is to force the organizations to share information with a compulsory common standard.
However, I can not know in advance the number of projects they have or plan, and it will change at every update, once a project finished or a new one planned. So, with your solution, I will have to check the number of rows and adapt my master table after each filling, giving me extra-work. That is what I wanted to avoid by referring to automatic updates, and why I thought about dynamic ranges, as I read that once "new items are added, the range will automatically expand"… Is it feasible?
Thank you again,
Best regards
Hi,
Yes you are correct that dynamic range names do automatically expand, but your summary workbook as it's currently configured still needs to know which rows in the range name to grab. i.e. whilst you know the range name your summary table does not know how many rows it contains.
Your best option is to have a macro which either builds the summary sheet from scratch each time you run it. This can either be along the lines I mentioned earlier, or since you know the range names the macro could copy the range defined by the name and paste it to the summary.
Regards
Richard Buttrey
If this was useful then please rate it appropriately.
Click the small star iconat the bottom left of my post.
Ok,
So I will opt for the macro solution, even if I haven't big experience on this. But everyone needs to begin one day. Do you know some good tutorials where I can learn codes for such tasks ? I have the whole weekend to look into.
By the way, what do you mean by "builds the summary sheet from scratch each time you run it". Does this means that the summary sheet will only be built (so updated) when the workbook is opened ? Creating an update button could be the solution, right ?
Thank you again Richard,
Best,
Hi,
See post # 4 in this thread from yesterday http://www.excelforum.com/excel-gene...48#post2679748
It's exactly the same as your situation. By 'build from scratch' all I meant was that for tasks like these, when some sheets may have been added to since the last time you updated the summary and some not, it's often less trouble to clear out the summary completely and build everything again. Otherwise you have to write code to record which rows from each sheet have already been added to the summary.
Study the macro it contains and hopefully you'll be able to adapt it to your particular situation.
Regards
Richard Buttrey
If this was useful then please rate it appropriately.
Click the small star iconat the bottom left of my post.
Dear Richard,
Thank you for your help.
I used the codes of the pipelines case.
So here is the code, adapted to my file and with some minor changes:
- Summary is not the first sheet
- All the sheets are not taking into account for the Summary, as I have plenty of sheets (summary, charts, mapping, codes...). Only those whose names end with "Proj." are considered.
- The name of the original sheet is not repeated into the summary sheet first colomn, the layout is exactly the same, so the macro is a bit lighter.
- Paste Special Values only instead of simple copy, in order to stick to the summary format.
Code:
[Option Explicit
Sub UpdateAllProjectsList()
Dim x As Long, llastrow As Long
Range("All_Projects").Offset(1, 0).ClearContents
Application.ScreenUpdating = False
For x = 1 To Sheets.Count
If Sheets(x).Name Like "*Proj." Then
If Sheets(x).Range("B5") <> "" Then
llastrow = Sheets(x).Range("B4").End(xlDown).Row
Sheets(x).Range("B5:Y" & llastrow).Copy
Sheets("ALL Projects").Range("B" & Rows.Count).End(xlUp).Offset(1, 0).PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
End If
End If
Next x
Sheets("ALL Projects").Range("A1").Select
End Sub]
That's it, thank you again for your help Richard,
See u
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks