+ Reply to Thread
Results 1 to 2 of 2

Subscript out of range error - need suggestions

  1. #1
    Registered User
    Join Date
    04-17-2014
    Location
    India
    MS-Off Ver
    Excel 2003
    Posts
    1

    Subscript out of range error - need suggestions

    Hi All,

    I am beginner to VBA in excel and learning by making a small dummy project. However I am facing a issue and not getting a way to resolve it. Checked so many threads but no luck.

    Issue - I have worksheet where I have 4 columns with 6 headers. I want to fill this 6 fields through user form. I have created a command btn in order to submit entries. Below is how my code looks like.

    ========================================================
    Please Login or Register  to view this content.
    ----------------------------------------------
    Please Login or Register  to view this content.
    ====================================================
    Combo box list in Sheet2 while I want my entries(including combo box column) to be in Sheet1. I checked sheet name and all looks fine.

    Seek all your suggestions.
    Last edited by kumar_excel; 04-20-2014 at 03:28 AM. Reason: Use code tags.

  2. #2
    Forum Expert Tinbendr's Avatar
    Join Date
    06-26-2012
    Location
    USA
    MS-Off Ver
    Office 2010
    Posts
    2,138

    Re: Subscript out of range error - need suggestions

    If you run the macro with sheet2 active, it's possible that the lastrow statement would return a incorrect value.

    Declare your variables and use With to fully qualify the reference.

    Please Login or Register  to view this content.
    David
    (*) Reputation points appreciated.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] Run-time error '9': subscript out of range - error occurs on multiple computers except one
    By BrettE in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 02-06-2014, 11:19 PM
  2. Runtime Error - Subscript out of Range / Object Error
    By JHRice in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 05-04-2012, 05:14 PM
  3. Defining Array - Runtime error 9, Subscript out of range error
    By MaartenW in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 02-03-2012, 07:32 AM
  4. [SOLVED] Type Mismatch error & subscript out of range error
    By Jeff Wright in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 05-14-2005, 03:06 PM

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