Results 1 to 15 of 15

Object Required error on Application.Match function.

Threaded View

  1. #1
    Registered User
    Join Date
    04-05-2011
    Location
    Central New York State
    MS-Off Ver
    Excel 2007
    Posts
    13

    Object Required error on Application.Match function.

    The code below is throwing a Run-Time Error 424 - Object Required. The bolded line below is highlighted by the debugger. I've also checked the values while debugging; sdcon is the date that it should be (6/6/2011, based on the cell I've been starting with). I've also deliberately set the dates range as the exact cell it should be, which it shows up as when I check the value during debugging, but no matter what I've done to that formula, I cannot get past the Object Required error.

    And ideas, please? This is driving me insane because I'm so close to being done with this project...

    Thanks!


    Private Sub btn_OK_Click()
    Dim theschedule As Range
    Set theschedule = ActiveCell
    Dim sdcon As Date
    Dim edcon As Date
    sdcon = Format$(txt_Start.Text, "m/d/yyyy")
    edcon = Format$(txt_End.Text, "m/d/yyyy")
    Dim dates As Range
    Set dates = Sheets(1).Range("A2:IH2")
    Dim cstart As Range
    Dim cend As Range
    
    Dim dstart As Long
    Dim dend As Long
    Dim i As Long
    Set cstart = Application.Match(sdcon, dates, 0)
    Set cend = Application.Match(edcon, dates, 0)
    
    dstart = cstart.Cells.Column
    dend = cend.Cells.Column
    
    Select Case True
       'Do Work
    End Select
    Unload Me
    End Sub
    Last edited by ctckark1; 06-12-2011 at 10:59 AM.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1