Custom Views

G

Guest

I have written an application that formats a spreadsheet using data that a
user pastes into it. This spreadsheet that gets formatted is any spreadsheet
within the workbook that the application was built for. Any of the
spreadsheets that gets formatted are all formatted the same way, with the
same column layout, headers, etc.

There are different users of this application, and each has their own
preference for which columns get hidden for any given situation. So, I'd
like to have each user be able to define their own set of Custom Views that
they can save with the Excel workbook, and then select the Custom View to use
for any given sheet.

In testing, it seems that each Custom View is somehow linked to the
worksheet that it was created for, and cannot be applied to any other
worksheet. Is there a way that a Custom View can be altered in VBA to work
with a sheet other than the one it was created with? Any other ideas about
how to approach this?
 
N

NickHK

AFAIK, Custom Views are associated with the workbook, as each can contain
multiple windows, sheets etc.
As you can neither read the info associated with a view nor apply it to
another workbook, you would have to determine yourself the changes applied
for each views; I don't think is advisable.
The alternative is put the current data into a WB that contains the various
views.

If it is a single WB that all users access, you could provide a list of
views based on the Username, if the views are named appropriately e.g
John_TotalsOnly, Mary_TotalsOnly.
Then loop through all the views, only adding those to a listbox that are
LIKE Environ("Username").

Or if it's only hide/unhide rows/columns, you could save some suitable data
in the users personal.xls and apply those settings to the
ActiveSheet/ActiveWorkbook when triggered by the user from a button/menu
entry.

A few ideas anyway..

NickHK
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top