Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I want to write a function in VBA which multiplies two numbers together as
follows =Multiply(A,B,5) A is the first value B is the array, eg. A1:A10 5 is the 5th value of the array. Would anybody be able to help me with this ? Thanks |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Try something like
Function Mult(Num1, Rng As Range, N As Long) As Double Mult = Num1 * Rng.Cells(N) End Function -- Cordially, Chip Pearson Microsoft MVP - Excel Pearson Software Consulting, LLC www.cpearson.com "Ali Baba" wrote in message ... I want to write a function in VBA which multiplies two numbers together as follows =Multiply(A,B,5) A is the first value B is the array, eg. A1:A10 5 is the 5th value of the array. Would anybody be able to help me with this ? Thanks |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Public Function Multiply(num as double, b as Range, idx as Long)
Multiply = num * b(idx).Value End Function -- Regards, Tom Ogilvy "Ali Baba" wrote in message ... I want to write a function in VBA which multiplies two numbers together as follows =Multiply(A,B,5) A is the first value B is the array, eg. A1:A10 5 is the 5th value of the array. Would anybody be able to help me with this ? Thanks |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
What have you tried and where are you stuck?
-- Regards, Tushar Mehta www.tushar-mehta.com Excel, PowerPoint, and VBA add-ins, tutorials Custom MS Office productivity solutions In article , says... I want to write a function in VBA which multiplies two numbers together as follows =Multiply(A,B,5) A is the first value B is the array, eg. A1:A10 5 is the 5th value of the array. Would anybody be able to help me with this ? Thanks |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Problem with SUMPRODUCT and Arrays | Excel Worksheet Functions | |||
Problem using arrays in Excel Charts from VBA | Excel Programming | |||
VBA (arrays problem) | Excel Programming | |||
Problem with plotting a chart when using arrays as Values and Xvalues | Charts and Charting in Excel | |||
Elusive Problem with Arrays | Excel Programming |