#1   Report Post  
Th10ECn
 
Posts: n/a
Default 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   Report Post  
Debra Dalgleish
 
Posts: n/a
Default

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 he

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   Report Post  
Dave Peterson
 
Posts: n/a
Default

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   Report Post  
okaizawa
 
Posts: n/a
Default

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   Report Post  
Dave Peterson
 
Posts: n/a
Default

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
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
Duplicating worksheet-level names jmg092548 Excel Discussion (Misc queries) 5 August 14th 05 11:11 PM
Finding Duplicate Names from Different Lists... PokerZan Excel Discussion (Misc queries) 1 July 8th 05 09:58 AM
lookup Ian Jones New Users to Excel 3 May 18th 05 08:57 AM
sorting names alphabetically when names may start with numbers John Smith Excel Discussion (Misc queries) 3 May 11th 05 08:06 PM
How can I find the common names in two columns of names? hako Excel Discussion (Misc queries) 2 December 8th 04 01:59 AM


All times are GMT +1. The time now is 01:57 AM.

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

About Us

"It's about Microsoft Excel"