Results 1 to 3 of 3

declaring variables help

Threaded View

  1. #1
    Registered User
    Join Date
    02-12-2013
    Location
    England
    MS-Off Ver
    Excel 2010
    Posts
    68

    declaring variables help

    Public Sub SS(ID)
    Dim Seat As Range
    Sheets("Seats").Activate
       Range("A2").Select
           x = ActiveCell.CurrentRegion.Rows.Count
        Set Seat = Sheets("Seats").Range("A2:A" & x)
           
        SeatID = "ID"
        Seat.Find(SeatID).Select
        ActiveCell.Offset(0, 2).Value = ("1")
        Call AVF
    End Sub
    This code is used to book a single seat at one time. When a seat button is clicked it will call this function and this code will receive the id of the seat and will locate it on a worksheet. I have used this code before just in a different scenario and it worked. However in this case it works until one point where it can not find "Seat" that is highlighted above, even when I have declared what "Seat" is above, with the de bugger telling me that there is a "Run time error - 91: object variable or with block variable not declared" ?????
    Last edited by arlu1201; 03-14-2013 at 02:36 PM. Reason: Use code tags in future.

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