Find Command

A

Adam

I can't figure out why this isn't working. I am getting
a "Object Required" compiler error after the n =

With wks_S.Range("B2:B" & SectionsFinalRow)
Set n = .Find(1922892106,LookIn:=xlValues)

Thank you
 
J

JE McGimpsey

What have you Dim'd n as?

When you use Set, n must be an object, in this case a Range.
 
G

Guest

I have it set as an integer because I later use that
number to call upon that row. What should I set it to?
 
G

Guest

Here is what I have. I am now getting an overflow
error. Thanks a lot for the help.

Dim c As Range
Dim n As Integer

With wks_S.Range("B2:B" & SectionsFinalRow)
Set c = .Find(1922892106,LookIn:=xlValues)
If Not c Is Nothing Then
n = c.Value
End If
End With
 
F

Frank Kabel

Hi
quite normal as this value is more than an integer can store. Try:
Dim n As double
 
G

Guest

Thank you so much for all of your help. However, it
still isn't working just right. I want n to be the row
of the location of this cell. It is giving me the value.

Dim c As Range
Dim n As Double

With wks_S.Range("B2:B" & SectionsFinalRow)
Set c = .Find(1922892106,LookIn:=xlValues)
If Not c Is Nothing Then
n = c.Value

End If
End With
-----Original Message-----
Hi
quite normal as this value is more than an integer can store. Try:
Dim n As double

--
Regards
Frank Kabel
Frankfurt, Germany

Here is what I have. I am now getting an overflow
error. Thanks a lot for the help.

Dim c As Range
Dim n As Integer

With wks_S.Range("B2:B" & SectionsFinalRow)
Set c = .Find (1922892106,LookIn:=xlValues)
If Not c Is Nothing Then
n = c.Value
End If
End With

-----Original Message-----
Hi
you have to define n as range and access its value with
n.value

--
Regards
Frank Kabel
Frankfurt, Germany

I have it set as an integer because I later use that
number to call upon that row. What should I set it to?



-----Original Message-----
What have you Dim'd n as?

When you use Set, n must be an object, in this case a
Range.
 
F

Frank Kabel

Hi
use
n = c.row

--
Regards
Frank Kabel
Frankfurt, Germany

Thank you so much for all of your help. However, it
still isn't working just right. I want n to be the row
of the location of this cell. It is giving me the value.

Dim c As Range
Dim n As Double

With wks_S.Range("B2:B" & SectionsFinalRow)
Set c = .Find(1922892106,LookIn:=xlValues)
If Not c Is Nothing Then
n = c.Value

End If
End With
-----Original Message-----
Hi
quite normal as this value is more than an integer can store. Try:
Dim n As double
 

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