Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Passing a range to a function
Formul in Excel looks like this:
=TestForEach(F7:J8) Function TestForEach(a As Range) Dim cell As Range For Each cell In Range(a) Msgbox("Hello") Next End Function Whats worg with this picture. I am trying to pass a range of cells from excel to this function and nothing happens. For some reason I am not using the "a" range correctly. |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Passing a range to a function
David
Not sure what your function does but a is already set to a range so just use a Function TestForEach(a As Range) Dim cell As Range For Each cell In a Msgbox("Hello") Next End Function -- HTH Nick Hodge Microsoft MVP - Excel Southampton, England www.nickhodge.co.uk HIS "David Bell" <David wrote in message ... Formul in Excel looks like this: =TestForEach(F7:J8) Function TestForEach(a As Range) Dim cell As Range For Each cell In Range(a) Msgbox("Hello") Next End Function Whats worg with this picture. I am trying to pass a range of cells from excel to this function and nothing happens. For some reason I am not using the "a" range correctly. |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Passing a range to a function
I need to check a range of cells for materials choosin for a beam,
ie. DF, DF #2 & Btr, DF #1, PSL, LVL, ect They may select 1 or several materials to use for the beam check. The user needs to send me a range where the materials are specified and then I will do calculations to determine the min size and material for the beam and / or give them a choice of all amterials and sizes allowable Formula in Excel looks like this: =TestForEach(F7:J8) Function TestForEach(a As Range) Dim cell As Range For Each cell In Range(a) 'Msgbox("Hello") Call CalculatMinimumBeamSize(cell, returnvalue) Next End Function |
#5
Posted to microsoft.public.excel.programming
|
|||
|
|||
Passing a range to a function
I got it working, Thanks for the help. The problem was the "in a" instead of
"Range(a)" and using "cell" for the data |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Passing a range to a function | Excel Programming | |||
Passing a range into a VBA function | Excel Programming | |||
Passing range as an argument in a function | Excel Programming | |||
Passing a Range to a Function Problem | Excel Programming | |||
Passing an unkown range to a function | Excel Programming |