How do you name and use a custom Layout

G

Guest

I have a spreadsheet with 30 coloumns. Differnt users access this spreadsheet
and depending on their login name I wanted to display a different layout for
differnt users. I have tried using custom view but it does not work. I tried
cutting and inserting the cut colomn into a differnt part of the spreadsheet
and named the custom view, but it did not go to it from the default layout.
In other words it appears you cannot use custom views to view different
layout options
 
B

Bill Kuunders

Not sure how you are going to tell the system the login name.
But the custom views should work.

I start with naming the normal view.........
You would then need to hide the columns and add a new view name.
make sure to keep the "hidden rows ,collumns etc"selected

To re-call the views with a macro instruction use:
ActiveWorkbook.Customviews ("yourname").Show
 
G

Guest

Bill, getting a user login name from a Windows computeris the real easy bit.
In the macro I use: dbuser = Environ("username") where dbuser is the
variable assigned to the environ function. I then use dbuser in a lookup
function. The custom view does not work for what I am trying to do. Basically
I have a whole bunch of people on a roster, and depending on who accesses
this roster decides how to display the people. For instance group all the
trades together, then group all the technical together. When Admin access the
roster the columns with the names in would be grouped Left to Right
alphabetically. Try cutting and then inserting a cut column into a differnt
Col(say from D1 to A1) and then save that view. When you try to show that
view from the default view it does not work. I don't want to hide columns,
just re-arrange them depending on the user login.
 
B

Bill Kuunders

Looks like you need to record the cut and paste actions as subroutines
within the macro.
I.e. if dbuser =.................then sortforadmin
elseif dbuser =.................then sortforprodn
you could do this as a "before open" routine.

Hope that helps
Bill K
 
G

Guest

Tried that...real messy...especialy if the column you paste goes into a
column with merged cells. I am now looking at creating custom lists (which
you can anme as well) and then sort the spreadsheet on those custom lists. My
first attempt didn't work as it appears it sorts on the first col in the
group and does not plonk the whole group into the new location. The VB site
is easy...its working out how escel does things.
 
B

Bill Kuunders

It appears you know enough to get the right method eventually.
Just one advice
get writ of the merged cells
they are a curse
they are normally only used to make things look pritty
you can often achieve the same result by using borders

Have fun
Bill K
 

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