I am trying to use a function to return the address of visible cells in a specified range.
e.g
Assume addv is the range B2:B10 and that cells B3 and B4 are hidden.
Function addvisible(addv As Range)
addvisible = addv.SpecialCells(xlCellTypeVisible).Address
End Function
The above code returns the address as $B2:B10 instead of $B2,$B5:$B10.
However if I use the following Sub,
Sub addvisible2()
MsgBox Range("G34:R34"
.SpecialCells(xlCellTypeVisible).Address
End Sub
It returns $B2,$B5:$B10 as required.
Can any suggest how I can modify my function to return the required range and also why the results from the function and sub are different.
Thanks
Cage
e.g
Assume addv is the range B2:B10 and that cells B3 and B4 are hidden.
Function addvisible(addv As Range)
addvisible = addv.SpecialCells(xlCellTypeVisible).Address
End Function
The above code returns the address as $B2:B10 instead of $B2,$B5:$B10.
However if I use the following Sub,
Sub addvisible2()
MsgBox Range("G34:R34"
End Sub
It returns $B2,$B5:$B10 as required.
Can any suggest how I can modify my function to return the required range and also why the results from the function and sub are different.
Thanks
Cage