Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5
Default returning number of subscripts? MyVar(x)

With MyVar(x),

x being unknown.

Is their a method to find x?

Jason


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default returning number of subscripts? MyVar(x)

Jason,

The question is unclear. x is a variable in this case, which must have been
set within the code and you can query it

MsgBox x

Debug.Print x

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"Jason" wrote in message
...
With MyVar(x),

x being unknown.

Is their a method to find x?

Jason




  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,824
Default returning number of subscripts? MyVar(x)

Are you looking for the largest index for that array?
msgbox ubound(myVar)



Jason wrote:

With MyVar(x),

x being unknown.

Is their a method to find x?

Jason


--

Dave Peterson

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,236
Default returning number of subscripts? MyVar(x)

Are you trying to get the index in an array?

Example:


Sub test()
Dim arr() As Long, i As Long, blnFound As Boolean, lngFind As Long

ReDim arr(1 To 100)
For i = 1 To 100
arr(i) = i * 5
Next


'' find

lngFind = 50
blnFound = False
For i = LBound(arr) To UBound(arr)
If arr(i) = lngFind Then
blnFound = True
Exit For
End If
Next

If blnFound Then
MsgBox i
End If

End Sub


--
Rob van Gelder - http://www.vangelder.co.nz/excel


"Jason" wrote in message
...
With MyVar(x),

x being unknown.

Is their a method to find x?

Jason




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
Is there a way to use subscripts in my formulas? Neil Cash Excel Discussion (Misc queries) 4 May 11th 09 01:45 PM
Subscripts James Excel Discussion (Misc queries) 6 July 16th 08 02:25 PM
Superscripts and Subscripts LEW Excel Discussion (Misc queries) 0 November 10th 05 03:06 PM
Is there a way to have "subscripts" in Excel? Sam Excel Discussion (Misc queries) 3 July 18th 05 12:50 PM


All times are GMT +1. The time now is 08:09 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"