Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 441
Default Resize method fails for 1-D array?

I am using Office 2003 on Windows XP.

A one-dimensional array (i.e. the array has one column of data in multiple
rows) is loaded from a custom function. This array holds a list of all the
file names in a folder that the user selects.

When I try to use the "Resize" method to shotgun the data into a sheet I get
a "subscript out of range" error. The error appears to be in the second
"UBound" clause in the following line:

Sheets(msSheetName).[A1].Resize(UBound(mvaFileName, 1), _
UBound(mvaFileName, 2)).Value = mvaFileName

The array "mvaFileName" is dimensioned at module level as a variant.

The "resize" method is the fastest and most convenient method I know to
blast data into a sheet from an array. How can I get this to function?

Thanks in advance for your assistance.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,302
Default Resize method fails for 1-D array?

Hi Quartz,

Try:

msSheetName.Range("A1"). _
Resize(UBound(mvaFileName) - _
LBound(mvaFileName) + 1) = mvaFileName


---
Regards,
Norman


"quartz" wrote in message
...
I am using Office 2003 on Windows XP.

A one-dimensional array (i.e. the array has one column of data in multiple
rows) is loaded from a custom function. This array holds a list of all the
file names in a folder that the user selects.

When I try to use the "Resize" method to shotgun the data into a sheet I
get
a "subscript out of range" error. The error appears to be in the second
"UBound" clause in the following line:

Sheets(msSheetName).[A1].Resize(UBound(mvaFileName, 1), _
UBound(mvaFileName, 2)).Value = mvaFileName

The array "mvaFileName" is dimensioned at module level as a variant.

The "resize" method is the fastest and most convenient method I know to
blast data into a sheet from an array. How can I get this to function?

Thanks in advance for your assistance.



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 783
Default Resize method fails for 1-D array?

quartz wrote:
I am using Office 2003 on Windows XP.

A one-dimensional array (i.e. the array has one column of data in multiple
rows)

That is not a one-dimensional array; it is a two-dimensional array.

is loaded from a custom function. This array holds a list of all the
file names in a folder that the user selects.

When I try to use the "Resize" method to shotgun the data into a sheet I get
a "subscript out of range" error. The error appears to be in the second
"UBound" clause in the following line:

Sheets(msSheetName).[A1].Resize(UBound(mvaFileName, 1), _
UBound(mvaFileName, 2)).Value = mvaFileName
. . .


No, the error is that you need Sheets("msSheetName") instead of
Sheets(msSheetName)

Alan Beban
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 441
Default Resize method fails for 1-D array?

Thanks Norman, but now I get only the first array element repeated for every
line...any further suggestions?

"Norman Jones" wrote:

Hi Quartz,

Try:

msSheetName.Range("A1"). _
Resize(UBound(mvaFileName) - _
LBound(mvaFileName) + 1) = mvaFileName


---
Regards,
Norman


"quartz" wrote in message
...
I am using Office 2003 on Windows XP.

A one-dimensional array (i.e. the array has one column of data in multiple
rows) is loaded from a custom function. This array holds a list of all the
file names in a folder that the user selects.

When I try to use the "Resize" method to shotgun the data into a sheet I
get
a "subscript out of range" error. The error appears to be in the second
"UBound" clause in the following line:

Sheets(msSheetName).[A1].Resize(UBound(mvaFileName, 1), _
UBound(mvaFileName, 2)).Value = mvaFileName

The array "mvaFileName" is dimensioned at module level as a variant.

The "resize" method is the fastest and most convenient method I know to
blast data into a sheet from an array. How can I get this to function?

Thanks in advance for your assistance.




  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 441
Default Resize method fails for 1-D array?

Thanks, but that is not correct and it may not be apparent from my post, but
"msSheetName" is string variable and therefore does not take the quotes.

Thanks anyway for your post.

"Alan Beban" wrote:

quartz wrote:
I am using Office 2003 on Windows XP.

A one-dimensional array (i.e. the array has one column of data in multiple
rows)

That is not a one-dimensional array; it is a two-dimensional array.

is loaded from a custom function. This array holds a list of all the
file names in a folder that the user selects.

When I try to use the "Resize" method to shotgun the data into a sheet I get
a "subscript out of range" error. The error appears to be in the second
"UBound" clause in the following line:

Sheets(msSheetName).[A1].Resize(UBound(mvaFileName, 1), _
UBound(mvaFileName, 2)).Value = mvaFileName
. . .


No, the error is that you need Sheets("msSheetName") instead of
Sheets(msSheetName)

Alan Beban



  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,302
Default Resize method fails for 1-D array?

Hi Quartz,

Try:

msSheetName.Range("A1"). _
Resize(UBound(mvaFileName) - _
LBound(mvaFileName) + 1) = _
Application.Transpose(mvaFileName)


---
Regards,
Norman



"quartz" wrote in message
...
Thanks Norman, but now I get only the first array element repeated for
every
line...any further suggestions?

"Norman Jones" wrote:

Hi Quartz,

Try:

msSheetName.Range("A1"). _
Resize(UBound(mvaFileName) - _
LBound(mvaFileName) + 1) = mvaFileName


---
Regards,
Norman


"quartz" wrote in message
...
I am using Office 2003 on Windows XP.

A one-dimensional array (i.e. the array has one column of data in
multiple
rows) is loaded from a custom function. This array holds a list of all
the
file names in a folder that the user selects.

When I try to use the "Resize" method to shotgun the data into a sheet
I
get
a "subscript out of range" error. The error appears to be in the second
"UBound" clause in the following line:

Sheets(msSheetName).[A1].Resize(UBound(mvaFileName, 1), _
UBound(mvaFileName, 2)).Value = mvaFileName

The array "mvaFileName" is dimensioned at module level as a variant.

The "resize" method is the fastest and most convenient method I know to
blast data into a sheet from an array. How can I get this to function?

Thanks in advance for your assistance.






  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 441
Default Resize method fails for 1-D array?

Thanks!

"Norman Jones" wrote:

Hi Quartz,

Try:

msSheetName.Range("A1"). _
Resize(UBound(mvaFileName) - _
LBound(mvaFileName) + 1) = _
Application.Transpose(mvaFileName)


---
Regards,
Norman



"quartz" wrote in message
...
Thanks Norman, but now I get only the first array element repeated for
every
line...any further suggestions?

"Norman Jones" wrote:

Hi Quartz,

Try:

msSheetName.Range("A1"). _
Resize(UBound(mvaFileName) - _
LBound(mvaFileName) + 1) = mvaFileName


---
Regards,
Norman


"quartz" wrote in message
...
I am using Office 2003 on Windows XP.

A one-dimensional array (i.e. the array has one column of data in
multiple
rows) is loaded from a custom function. This array holds a list of all
the
file names in a folder that the user selects.

When I try to use the "Resize" method to shotgun the data into a sheet
I
get
a "subscript out of range" error. The error appears to be in the second
"UBound" clause in the following line:

Sheets(msSheetName).[A1].Resize(UBound(mvaFileName, 1), _
UBound(mvaFileName, 2)).Value = mvaFileName

The array "mvaFileName" is dimensioned at module level as a variant.

The "resize" method is the fastest and most convenient method I know to
blast data into a sheet from an array. How can I get this to function?

Thanks in advance for your assistance.






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
Why Copy/Paste fails using Offset & Resize of myRange? [email protected] Excel Discussion (Misc queries) 3 November 21st 06 02:06 AM
Paste method fails in VBA lalu Excel Programming 4 October 14th 05 03:06 AM
Workbooks.open method fails JAT Excel Programming 3 January 24th 05 08:19 PM
Copy method fails in IIS Domien Excel Programming 0 February 19th 04 02:46 PM
resize method Tim McPhillips Excel Programming 3 August 11th 03 10:43 PM


All times are GMT +1. The time now is 10:54 PM.

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"