LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 39
Default Array Help

Below is a sub that I wrote to multiply range "a" and range "b" to get range
"c". Range "a" would be a1:a10, range b would be b1:b10, range "d" would be
"c1:c10". It is not working and am getting an "object required" error. I am
assuming that the error message refers to darray but is darray not an object?
I am writing this code so I could avoid functions in the worksheet where my
rows changes often. I don't want to copy and paste the function but just
have the excel automatically perform the calculation upon an event change.
Also, if you could refer me to a book or website where there is more array
examples or information, it would be appreciated.

Sub test()

Dim myarray As Variant
Dim mycount As Integer

aarray = Worksheets("sheet1").Range("a")
barray = Worksheets("sheet1").Range("b")
darray = Worksheets("sheet1").Range("d")


For mycount = LBound(aarray) To UBound(aarray) '0 to 3
darray(mycount, 1).Value = WorksheetFunction.Product(aarray(mycount,
1), barray(mycount, 1))
Next mycount

End Sub
--
Thanks!
 
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
Prevent cell/array references from changing when altering/moving thecell/array nme Excel Discussion (Misc queries) 1 September 19th 08 01:53 PM
meaning of : IF(Switch; Average(array A, array B); array A) DXAT Excel Worksheet Functions 1 October 24th 06 06:11 PM
Array problem: Key words-Variant Array, single-element, type mismatch error davidm Excel Programming 6 November 9th 05 05:54 AM
Array problem: Key words-Variant Array, single-element, type mismatch error davidm Excel Programming 1 November 8th 05 04:21 AM
variant array containing cel adresses convert to actual ranges-array Peter[_21_] Excel Programming 5 December 10th 03 09:50 PM


All times are GMT +1. The time now is 09:42 AM.

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"