+ Reply to Thread
Results 1 to 5 of 5

Custom View Names

Hybrid View

  1. #1
    Th10ECn
    Guest

    Custom View Names

    I use very large spreadsheets with custom views. However, I can't find a way
    to reference the names of the views in formulas, etc. Is there a way that
    I'm overlooking or is it impossible to use the names except with the View ->
    Custom Views dialog box? I would prefer to do it in a worksheet formula but
    VBA would be ok.

  2. #2
    Debra Dalgleish
    Guest

    Re: Custom View Names

    A Custom View is stored information about your worksheet settings, and
    you can't refer to it in a formula.

    You could name a range, and refer to that in the formula. There are
    instructions in Excel's Help, and here:

    http://www.contextures.com/xlNames01.html

    Th10ECn wrote:
    > I use very large spreadsheets with custom views. However, I can't find a way
    > to reference the names of the views in formulas, etc. Is there a way that
    > I'm overlooking or is it impossible to use the names except with the View ->
    > Custom Views dialog box? I would prefer to do it in a worksheet formula but
    > VBA would be ok.



    --
    Debra Dalgleish
    Excel FAQ, Tips & Book List
    http://www.contextures.com/tiptech.html


  3. #3
    Dave Peterson
    Guest

    Re: Custom View Names

    I don't think you can determine the name of the current view.

    Th10ECn wrote:
    >
    > I use very large spreadsheets with custom views. However, I can't find a way
    > to reference the names of the views in formulas, etc. Is there a way that
    > I'm overlooking or is it impossible to use the names except with the View ->
    > Custom Views dialog box? I would prefer to do it in a worksheet formula but
    > VBA would be ok.


    --

    Dave Peterson

  4. #4
    okaizawa
    Guest

    Re: Custom View Names

    Hi,

    how about getting the current view name from a built-in control.
    I have not done enough testing but this seems to work (in Excel 2000)

    Function CurrentView(Optional DummyArg As Variant) As String
    Dim cbo As CommandBarComboBox
    On Error Resume Next
    Set cbo = Application.CommandBars.FindControl(ID:=950)
    On Error GoTo 0
    If cbo Is Nothing Then
    With Application.CommandBars.Add(Temporary:=True)
    Set cbo = .Controls.Add(ID:=950)
    .Enabled = False
    End With
    End If
    CurrentView = cbo.Text
    End Function

    --
    HTH,

    okaizawa


    Th10ECn wrote:
    > I use very large spreadsheets with custom views. However, I can't find a way
    > to reference the names of the views in formulas, etc. Is there a way that
    > I'm overlooking or is it impossible to use the names except with the View ->
    > Custom Views dialog box? I would prefer to do it in a worksheet formula but
    > VBA would be ok.


  5. #5
    Dave Peterson
    Guest

    Re: Custom View Names

    It looks like that this is picking up the first name in the list.

    That view may not be the current view.

    And if I showed that view, then changed some settings (unhid columns), the
    builtin dialog didn't change (the top item was still selected).

    okaizawa wrote:
    >
    > Hi,
    >
    > how about getting the current view name from a built-in control.
    > I have not done enough testing but this seems to work (in Excel 2000)
    >
    > Function CurrentView(Optional DummyArg As Variant) As String
    > Dim cbo As CommandBarComboBox
    > On Error Resume Next
    > Set cbo = Application.CommandBars.FindControl(ID:=950)
    > On Error GoTo 0
    > If cbo Is Nothing Then
    > With Application.CommandBars.Add(Temporary:=True)
    > Set cbo = .Controls.Add(ID:=950)
    > .Enabled = False
    > End With
    > End If
    > CurrentView = cbo.Text
    > End Function
    >
    > --
    > HTH,
    >
    > okaizawa
    >
    > Th10ECn wrote:
    > > I use very large spreadsheets with custom views. However, I can't find a way
    > > to reference the names of the views in formulas, etc. Is there a way that
    > > I'm overlooking or is it impossible to use the names except with the View ->
    > > Custom Views dialog box? I would prefer to do it in a worksheet formula but
    > > VBA would be ok.


    --

    Dave Peterson

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1