Error Checking in Excel
Thanks Thanks:  0
Likes Likes:  0
Results 1 to 2 of 2

Thread: Object Required error message

  1. #1
    Guest

    Default

    Hello people

    I am trying to get the row number of a cell which is found by


    Set f = Columns(3).Find(What:=ColrToFind, LookAt:=xlWhole)

    and inside the if...else condition I put
    Dim fRow As Double
    Set fRow = f.Row

    But I got a message --> Object required

    Why??

    Please Help

  2. #2
    MrExcel MVP Damon Ostrander's Avatar
    Join Date
    Feb 2002
    Location
    Denver, Colorado USA
    Posts
    4,239
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    Since fRow is declared as double precision and is therefore not an object, the Set keyword is not appropriate. I suggest you change it to:

    Dim fRow As Long
    fRow = f.Row

    Since a row number is a long integer, and there is no need to make it double precision.


    Keep Excelling.

    Damon

    VBAexpert Excel Consulting
    LinkedIn Profile http://www.linkedin.com/pub/damon-ostrander/7/79/a93
    AllExperts Profile http://www.allexperts.com/ep/1059-30...-Ostrander.htm

Some videos you may like

User Tag List

Like this thread? Share it with others

Like this thread? Share it with others

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •