+ Reply to Thread
Results 1 to 2 of 2

Basic "run-time error 1004" problem

  1. #1
    Registered User
    Join Date
    08-31-2009
    Location
    Oslo
    MS-Off Ver
    Excel 2007
    Posts
    2

    Basic "run-time error 1004" problem

    Hi.

    I have opened a new excel workbook, and inserted an ActiveX command button. The command button is programmed in VB with the following code:

    Please Login or Register  to view this content.
    This produces the error "Run-time error '1004': Application-defined or object-defined error". I need help on how to select a range of cells, on a different worksheet, while using a variable as part of the cell adress. Thanks very much in advance!

  2. #2
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2010, 2019
    Posts
    40,689

    Re: Basic "run-time error 1004" problem

    In a code module, default range references are to the active sheet. In a sheet module, they are to the sheet in which the code appears. So, ...
    Please Login or Register  to view this content.
    Having corrected the reference, though, there's no reason to select those cells to operate on them, and good reason not to.
    Last edited by shg; 08-31-2009 at 12:31 PM.
    Entia non sunt multiplicanda sine necessitate

+ 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