Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 108
Default Unexpected result copying an array

Roedd <<Schizoid Man wedi ysgrifennu:

Hi,

I have a single column of numbers from 1 to 10. I've written the
following function to replicate these numbers in another column using
the matrix enter (Ctrl-Shift-Enter).


Your output array needs to be two dimensional:

Public Function copyArr(wk As Range) As Integer()

Dim outArr() As Integer
Dim i As Integer

i = wk.Rows.Count

Dim c As Integer
ReDim outArr(1 To i, 1 To 1) As Integer

For c = 1 To i
outArr(c, 1) = wk(c)
Next c

copyArr = outArr

End Function

HTH

Rob


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
Unexpected Result Hardeep_kanwar[_2_] Excel Worksheet Functions 2 January 16th 09 03:29 PM
FV Function result is unexpected. RushatiINDIA Excel Worksheet Functions 8 February 28th 07 03:13 AM
unexpected result from inputbox HRman Excel Programming 2 January 16th 06 09:12 PM
Unexpected result Biff Excel Worksheet Functions 5 June 3rd 05 02:56 AM
FileSearch gives unexpected result Stephen Allen[_2_] Excel Programming 2 December 21st 03 01:06 PM


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