+ Reply to Thread
Results 1 to 3 of 3

Run time error - 1004

  1. #1
    Registered User
    Join Date
    07-19-2006
    Posts
    8

    Run time error - 1004

    i am trying to select a cell on worksheet before it goes through a loop process to add items to a combo box.

    adding the items is fine, the problem i have is selecting the cell to start in.

    this is my code for activating the sheet

    Activeworkbook.sheets("Data").Select

    whether i have select or activate on the end it works, the sheet is selected.

    BUT THEN

    .. i try and reference the cell to start by

    Range("A10").Select

    and i get a run time error 1004 - Select method of range class failed.

    ????

  2. #2
    Forum Contributor
    Join Date
    03-13-2005
    Posts
    6,195
    Quote Originally Posted by SydnTex
    i am trying to select a cell on worksheet before it goes through a loop process to add items to a combo box.

    adding the items is fine, the problem i have is selecting the cell to start in.

    this is my code for activating the sheet

    Activeworkbook.sheets("Data").Select

    whether i have select or activate on the end it works, the sheet is selected.

    BUT THEN

    .. i try and reference the cell to start by

    Range("A10").Select

    and i get a run time error 1004 - Select method of range class failed.

    ????
    Not too many answers - no idea what the problem is, but to open and load my array for the userform I use this code:
    Please Login or Register  to view this content.
    etc, does this help with any ideas?
    ---

  3. #3
    Registered User
    Join Date
    07-19-2006
    Posts
    8

    1004

    Hi,

    Thanks for the reply, my query is a little simpler i think. My combo box is on a form and i want to load the data from spreadsheet. This part i can do, the thing is i can not initialize or select a particular field to start from in the worksheet. I want to start from A10 but whenever i reference a cell to select, ie. Range("A10").select it then brings up the error, irrespective of which cell i reference. If i do not reference a cell it works but then i can not select the right data.

    ??

    Thanks




    Private Sub cmdEditInitiative_Click()

    ActiveWorkbook.Sheets("Data").Select

    Range("A10").Select

    Do
    If Not IsEmpty(ActiveCell.Value) Then
    frmEditInitiative.cmbInitiatives.AddItem ActiveCell.Value
    End If

    ActiveCell.Offset(1, 0).Select
    Loop Until ActiveCell.Value Like "Total*"

    frmEditInitiative.Show

+ Reply to Thread

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