Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 70
Default initialization of an array????

Hi,

I need to initialize MyArray (7)
By Monday. Tuesday,


I tried MyArray = (Monday,Tuesday,Wednesday,,)


But it doesnt work!??

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,986
Default initialization of an array????

Right out of VBA help file.

MyWeek = Array("Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun")


"Barb" wrote:

Hi,

I need to initialize MyArray (7)
By Monday. Tuesday,


I tried MyArray = (Monday,Tuesday,Wednesday,,)


But it doesnt work!??

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 947
Default initialization of an array????

If you can start with Sunday, perhaps...

Sub Demo()
Dim m
m = Application.GetCustomListContents(2)
'Otherwise adjust ...
m = Array(m(2), m(3), m(4), m(5), m(6), m(7), m(1))
End Sub

--
Dana DeLouis


"Barb" wrote in message
...
Hi,

I need to initialize MyArray (7)
By "Monday". "Tuesday",


I tried MyArray = ("Monday","Tuesday","Wednesday",,)


But it doesn't work!??



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7,247
Default initialization of an array????

Barb,

Try something like

Dim V(1 To 7) As String ' Best practice to specify both lower and upper
bounds
Dim N As Long
For N = 1 To 7
V(N) = Format(DateSerial(2001, 1, N), "dddd")
Next N


"Barb" wrote in message
...
Hi,

I need to initialize MyArray (7)
By Monday. Tuesday,


I tried MyArray = (Monday,Tuesday,Wednesday,,)


But it doesnt work!??


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
Test Initialization of an Array Neal Zimm Excel Programming 7 December 27th 06 04:58 PM
UserForm Initialization Patrick Simonds Excel Programming 1 January 21st 05 02:40 AM
Userform Initialization Patrick Simonds Excel Programming 2 May 22nd 04 10:17 PM
ShowDataForm Initialization Alan Excel Programming 2 February 11th 04 11:24 PM
List box initialization Tom Ogilvy Excel Programming 0 July 15th 03 05:41 PM


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