LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 16
Default Capture Custom View in a Variable

I am writing a procedure to modify custom views. The workbook has a
long list of defined custom views, of which a user could be working in
any one of them. In all likelihood, the changes that I would be
making in my procedure would be to a view that is different than the
one the user is currently working in.

What I want to do is to capture the current custom view selection in a
variable before I switch over to make my changes. That way, when my
procedure terminates, I can switch the view back to the one that the
user was working in without them even noticing that anything happened.

Here is some untested code to explain more specifically:

Sub ChangeCustomView()

dim UsersView as Variant 'or another type if better

set UsersView = 'this is where I am hung up -
'it should be the currently selected view

ActiveWorkbook.CustomViews("Example").Show
Call MakeChanges 'this subroutine would contain the specific
modifications
ActiveWorkbook.CustomViews(UsersView).Show
ActiveWorkbook.Save

End Sub


Thanks for your help.
Randy Eastland
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
How capture a date variable within a text cell? Capture a variable date & use with text[_2_] Excel Discussion (Misc queries) 4 November 28th 08 02:34 AM
Excel screen capture to capture cells and row and column headings jayray Excel Discussion (Misc queries) 5 November 2nd 07 11:01 PM
View Custom View with Sheet Protection John H[_2_] New Users to Excel 1 February 16th 07 05:54 PM
How to view a custom view when the worksheet is protected? JulesJam Excel Worksheet Functions 0 March 6th 06 02:15 PM
Missing "Custom View" entry from View menu mycroft777 Excel Discussion (Misc queries) 1 February 3rd 06 05:33 PM


All times are GMT +1. The time now is 08:04 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"