+ Reply to Thread
Results 1 to 6 of 6

Set a cell value to an object to be referenced for later

  1. #1
    Registered User
    Join Date
    04-12-2013
    Location
    Phoenix, Arizona
    MS-Off Ver
    Excel 2010
    Posts
    4

    Set a cell value to an object to be referenced for later

    Excel 2010 using Visual Basic for Applications code
    I am trying to set the value in a cell to the object lookup.

    I keep getting error 424
    Please Login or Register  to view this content.
    Last edited by Leith Ross; 04-12-2013 at 07:05 PM. Reason: Added Code Tags

  2. #2
    Forum Expert
    Join Date
    07-31-2010
    Location
    California
    MS-Off Ver
    Excel 2007
    Posts
    4,070

    Re: Set a cell value to an object to be referenced for later

    What do you mean by "object lookup"?

  3. #3
    Registered User
    Join Date
    04-12-2013
    Location
    Phoenix, Arizona
    MS-Off Ver
    Excel 2010
    Posts
    4

    Re: Set a cell value to an object to be referenced for later

    I used the term lookup as a variable to hold the value of the active cell
    I have read in many forums you have to declare it as an object to set the active cell value

  4. #4
    Registered User
    Join Date
    04-12-2013
    Location
    Phoenix, Arizona
    MS-Off Ver
    Excel 2010
    Posts
    4

    Re: Set a cell value to an object to be referenced for later

    Ok I found the issue the code is correct but I had cleared all conditional formatting manually and this caused something that created the 424 error. I went back to a previous version before clearing the formatting and it works great.

    Thanks anyway.

  5. #5
    Registered User
    Join Date
    04-12-2013
    Location
    Phoenix, Arizona
    MS-Off Ver
    Excel 2010
    Posts
    4

    Re: Set a cell value to an object to be referenced for later

    Ok I thought I had it fixed but I don't

    Dim Lookup As Object

    ActiveCell.Offset(0, 5).Select

    Set Lookup = ActiveCell.Value

    Not sure what is wrong. I need the actual value of the cell to be stored in lookup

    Any suggestions?

  6. #6
    Forum Expert
    Join Date
    07-31-2010
    Location
    California
    MS-Off Ver
    Excel 2007
    Posts
    4,070

    Re: Set a cell value to an object to be referenced for later

    Please don't use terminology unless you are absolutely sure you and others will know what it means. There is no "object lookup" as I think you are trying to use it. It sounds to me like you are just trying to hold the value of a specific range, in this situation five columns to the right, same row, of the active cell. If that is the case what you call it is less important than how you declare it. (google search "vba variable declaration") For example:

    Please Login or Register  to view this content.

+ 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