View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
David Bell David Bell is offline
external usenet poster
 
Posts: 1
Default 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.