Excel the cell exists using cell name

V

Vineeth

Hi,

iam developing a com addin for excel 2007, now i need to check the worksheet
contains cell named "A1"

how can implement this


like this
worksheet.cell.contains("A1")

Thanks
 
V

Vineeth

Hi,

thanks for your quick reply

my requirement is i need to get the values from user entered(means user can
choose range)

so i use worksheet.getrange method but if user enter a wrong range value
will give exception


how can avoid this bug
 
J

Jacob Skaria

Hi Vineeth

You can modify the below function written for VBA and use...myRange should
be declared as a Range object.

Function IsValidRange(strAddress As String) As Boolean
On Error Resume Next
Dim myRange As Range
Set myRange = Range(strAddress)
If Not myRange Is Nothing Then IsValidRange = True
End Function

If this post helps click Yes
 
V

Vineeth

Hi Jacob ,

thanks for your reply

when when i try to take the the range will fire exception

excelSheet.get_Range(0,0)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top