Determining what current custom view is

KC Cat

New Member
Joined
Dec 23, 2009
Messages
48
Hello to all,

I have the following code that is working very nicely.

Code:
Sub View_Show_Budgeting()

    Application.ScreenUpdating = False
    
    Dim rowVar As Integer
    rowVar = ActiveCell.Row
    
    If Range("ChangeOrderStatus") = 0 Then
        ActiveWorkbook.CustomViews("Budgeting").Show
        Range("CurrentViewStatus") = "View = Budgeting"
    Else
        ActiveWorkbook.CustomViews("Budgeting w/COs").Show
        Range("CurrentViewStatus") = "View = Budgeting w/COs"
    End If
    
    Application.ScreenUpdating = True

    Cells(rowVar, 1).Select

End Sub

Now, I have created another subroutine that I need to first establish which custom view is currently active. Then, this new subroutine will perform its actions, and will then need to return the view back to where it was. Please note, for what it's worth, that my custom view names can include spaces and the "/" character.

I'm not sure what function to use, or how, to "collect" this active view information.

Any help will be greatly appreciated!
 
Last edited:

Excel Facts

Test for Multiple Conditions in IF?
Use AND(test, test, test, test) or OR(test, test, test, ...) as the logical_test argument of IF.

Forum statistics

Threads
1,214,812
Messages
6,121,702
Members
449,048
Latest member
81jamesacct

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top