View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
Nick Hodge Nick Hodge is offline
external usenet poster
 
Posts: 1,173
Default Passing a range to a function

slight correct...know what it's doing...don't know why ;-)

--
HTH
Nick Hodge
Microsoft MVP - Excel
Southampton, England
www.nickhodge.co.uk
HIS


"Nick Hodge" wrote in message
...
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.