Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Types problems

Status
Not open for further replies.

sabascal

IS-IT--Management
Aug 20, 2002
85
GB
hi,

I am looping through all the range I have defined in my worbook:
=====================================

Sub Test ()
For Each n In ActiveWorkbook.Names
Msgbox ColNumber( n.Name)
Next n
End Sub
End Sub
==============================
ColNumber is a function that takes as argument a String. It returns an Integer
I am getting an error: Object doesn't support this property Error

Any way to bypass that either by changing my function data input type or converting .Name into a String??
 
sabascal,

First, that sub will not necessarily get you ALL the names in your workbook. I think I posted you on that in another thread.

Second, n.Name is a string like "MyRange"
How does your Column function return an integer from that?
Code:
Sub Test ()
For Each n In ActiveWorkbook.Names
       Msgbox Range(n.refersto).column
    Next n
End Sub
End Sub
:)


Skip,
Skip@TheOfficeExperts.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top