Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,101
Default Explain some things please

Looking at the code below, what do some of these mea? Like ReDim and ReDim
Preserve? And v(i). Is this a variable, and if so, why the i in parens?

ReDim v(0 To 0)

ReDim Preserve v(0 To i)

v(i) = "State" & Right(ctrl.Name, 1)

ActiveSheet.Shapes.Range(v).Select



  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 258
Default Explain some things please

Hi Mike,

see help for using arrays, should give you appropriate answers.

Regards,
Ivan

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,953
Default Explain some things please

Why not highlight the code in the VBE and hit F1.

--
Regards,
Tom Ogilvy


"Mike" wrote:

Looking at the code below, what do some of these mea? Like ReDim and ReDim
Preserve? And v(i). Is this a variable, and if so, why the i in parens?

ReDim v(0 To 0)

ReDim Preserve v(0 To i)

v(i) = "State" & Right(ctrl.Name, 1)

ActiveSheet.Shapes.Range(v).Select



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,101
Default Explain some things please

I have tried this and was looking for a simpler explanation. Plus, it doesn't
say anything about Preserve that I saw, or why you have (0 To 0) for ReDim.
Thanks anyways.

"Mike" wrote:

Looking at the code below, what do some of these mea? Like ReDim and ReDim
Preserve? And v(i). Is this a variable, and if so, why the i in parens?

ReDim v(0 To 0)

ReDim Preserve v(0 To i)

v(i) = "State" & Right(ctrl.Name, 1)

ActiveSheet.Shapes.Range(v).Select



  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,953
Default Explain some things please

If you highlighted redim and hit F1, it has all kinds of information on
Preserve.

Dim v() as Variant

declares v as a dynamic array of type variant.

Redim v(0 to 0)
initializes v to by a one dimensonal array with a lower bound of zero and an
upperbound of zero (therefore it is one element)

redim Preserve v(0 to i)
redimensions the array v (while preserving it existing content) to have a
lower bound of zero and an upper bound of the value in the variable i so it
has

i - 0 + 1 elements or i + 1 elements.

--
Regards,
Tom Ogilvy


"Mike" wrote:

I have tried this and was looking for a simpler explanation. Plus, it doesn't
say anything about Preserve that I saw, or why you have (0 To 0) for ReDim.
Thanks anyways.

"Mike" wrote:

Looking at the code below, what do some of these mea? Like ReDim and ReDim
Preserve? And v(i). Is this a variable, and if so, why the i in parens?

ReDim v(0 To 0)

ReDim Preserve v(0 To i)

v(i) = "State" & Right(ctrl.Name, 1)

ActiveSheet.Shapes.Range(v).Select





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
A few things Bryan De-Lara[_2_] Excel Worksheet Functions 6 November 3rd 08 04:58 PM
######THEY DO DIFFERENT THINGS TO GET IT############# keerthi Charts and Charting in Excel 0 April 30th 08 07:45 AM
two things at once? evanzo Excel Programming 2 November 29th 05 01:08 PM
2 things Srikanth Veera Excel Programming 2 September 26th 04 11:48 PM
2 things Michael Wise Excel Programming 6 March 5th 04 07:25 AM


All times are GMT +1. The time now is 04:47 PM.

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"