Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
What you have there looks fine to me assuming that everything is declared as
I would expect. Make sure to explicitly declare all of your variables... Sub This() Dim C as Range Dim Range1 as Range Set Range1 = range("A1:A10") For each C in Range1 Call FindMe(C) Next For End Sub Sub FindMe(byval Cell as Range) msgBox Cell.Address End Sub -- HTH... Jim Thomlinson "J@Y" wrote: Code: For each C in Range1 Call FindMe(C) Next For Sub FindMe(Cel as Range) ... End Sub Apparently, the C in the For statement won't get passed on to the FindMe Sub as a Range variable. I have to use Sub FindMe(Cel) without the "as Range" for this to work. Why is the C not a Range variable? I can do C.address and it returns a Cell address. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Variable type Confusion | Excel Programming | |||
What data type for Variable? | Excel Programming | |||
Trouble with variable type | Excel Programming | |||
type variable as argument of a sub | Excel Programming | |||
Variable Type - help me to solve this | Excel Programming |