+ Reply to Thread
Results 1 to 5 of 5

Assigning A Cell Address to A Variable, Using A Variable - Error '1003'

  1. #1
    Registered User
    Join Date
    01-08-2014
    Location
    Sheffield
    MS-Off Ver
    Excel 2003=7
    Posts
    25

    Assigning A Cell Address to A Variable, Using A Variable - Error '1003'

    Hi All,

    My Code:

    Please Login or Register  to view this content.
    In this code, I take the address of the Active Cell.
    Extract the row of the Active Cell.
    Find the last column with data in it, in that row.
    Set a cell address to Last_Cell_Address of the row of the Active Cell but the column being the last column in that row with data in it.

    The problem: The line
    Please Login or Register  to view this content.
    returns Error Code '1004' - 'Application defined or Object Defined error'.
    I've tried declaring my variables differently but end up with different errors still on the same line.

    Thanks in advance all!!

  2. #2
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643

    Re: Assigning A Cell Address to A Variable, Using A Variable - Error '1003'

    lastColumn & ":" & Found_Address4 will not produce a valid range reference - lastColumn is a number.
    If posting code please use code tags, see here.

  3. #3
    Registered User
    Join Date
    01-08-2014
    Location
    Sheffield
    MS-Off Ver
    Excel 2003=7
    Posts
    25

    Re: Assigning A Cell Address to A Variable, Using A Variable - Error '1003'

    Thanks....I've amended my code to this and still getting the same error...
    Please Login or Register  to view this content.

  4. #4
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643

    Re: Assigning A Cell Address to A Variable, Using A Variable - Error '1003'

    If you want to find the address of the last column with data on the same row as the active cell.
    Please Login or Register  to view this content.

  5. #5
    Registered User
    Join Date
    01-08-2014
    Location
    Sheffield
    MS-Off Ver
    Excel 2003=7
    Posts
    25

    Re: Assigning A Cell Address to A Variable, Using A Variable - Error '1003'

    That was such a short way! I went around the houses about fifty times....Thank you for your help Norie!

+ 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] Calling a function without assigning it to a variable cause an error.
    By gvag in forum Excel Programming / VBA / Macros
    Replies: 12
    Last Post: 10-28-2013, 05:20 AM
  2. Assigning a cell to a variable
    By penfold1992 in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 07-16-2013, 11:12 AM
  3. [SOLVED] Object variable error stumping me: trying to find last row and pass address to cell
    By trillium in forum Excel Programming / VBA / Macros
    Replies: 13
    Last Post: 09-18-2012, 02:20 PM
  4. Assigning a variable and pasting variable to last unused column.
    By Ageia in forum Excel Programming / VBA / Macros
    Replies: 15
    Last Post: 11-20-2008, 05:06 PM
  5. [SOLVED] Assigning a variable a value from a Cell in VBA
    By [email protected] in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 02-15-2006, 02:30 PM

Tags for this Thread

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