+ Reply to Thread
Results 1 to 7 of 7

Cell Reference returns error

  1. #1
    Registered User
    Join Date
    09-04-2013
    Location
    Saskatoon, Canada
    MS-Off Ver
    Excel 2010
    Posts
    22

    Cell Reference returns error

    I have some code where I find the last cell in a column, and add 1 to it so that I can input information into the next row.Note the two lines below. The first is what I want as each time the value of Z will change. The second is a manual code just for testing. The second line works and the first does not. The value of Z in my test is 382.

    What have I missed? Thanks in advance for your help.

    Please Login or Register  to view this content.

  2. #2
    Forum Expert jaslake's Avatar
    Join Date
    02-21-2009
    Location
    Atwood Lake in Mid NE Ohio...look it up.
    MS-Off Ver
    Excel 2010 2019
    Posts
    12,749

    Re: Cell Reference returns error

    Hi wiwchr

    It'll probably be something like this, depending on how you defined NR (Next Row)

    Please Login or Register  to view this content.
    John

    If you have issues with Code I've provided, I appreciate your feedback.

    In the event Code provided resolves your issue, please mark your Thread as SOLVED.

    If you're satisfied by any members response to your issue please use the star icon at the lower left of their post.

  3. #3
    Forum Expert
    Join Date
    05-01-2014
    Location
    California, US
    MS-Off Ver
    Excel 2010
    Posts
    1,795

    Re: Cell Reference returns error

    Quote Originally Posted by wiwchar View Post
    I have some code where I find the last cell in a column, and add 1 to it so that I can input information into the next row. Note the two lines below. The first is what I want as each time the value of Z will change. The second is a manual code just for testing. The second line works and the first does not. The value of Z in my test is 382. [....]
    Please Login or Register  to view this content.
    If Z is 382, Range("A382") is not an example of "add[ing] 1". Assuming you meant "A383", perhaps the following does what you require:
    Please Login or Register  to view this content.

  4. #4
    Registered User
    Join Date
    09-04-2013
    Location
    Saskatoon, Canada
    MS-Off Ver
    Excel 2010
    Posts
    22

    Re: Cell Reference returns error

    Jaslake,

    Thanks for the quick response. Z is the variable here to provide the row number. I have a starting point of B3 and then

    Please Login or Register  to view this content.
    This provides me with a value of t from

    Please Login or Register  to view this content.
    Then I have

    Please Login or Register  to view this content.
    So in my testing, initially t = 381, then increments to 382 and assigns that value to Z. I want the information from another workbook that is in C1 to go into this workbook in cell A382.

    Hopefully I have explained this a bit better. I tried the code, but could not get it to work.

    Thoughts? Maybe there is a better way than what I am attempting.

  5. #5
    Forum Expert jaslake's Avatar
    Join Date
    02-21-2009
    Location
    Atwood Lake in Mid NE Ohio...look it up.
    MS-Off Ver
    Excel 2010 2019
    Posts
    12,749

    Re: Cell Reference returns error

    Hi wiwchar

    Then joeu2004's Code is close...

    Please Login or Register  to view this content.
    Or
    Please Login or Register  to view this content.
    Where "Z" is the Row Number and "A" is the Column or 1 is the Column.

  6. #6
    Registered User
    Join Date
    09-04-2013
    Location
    Saskatoon, Canada
    MS-Off Ver
    Excel 2010
    Posts
    22

    Re: Cell Reference returns error

    Excellent. Thank you all for the quick responses.

    Have a great day!

  7. #7
    Forum Expert jaslake's Avatar
    Join Date
    02-21-2009
    Location
    Atwood Lake in Mid NE Ohio...look it up.
    MS-Off Ver
    Excel 2010 2019
    Posts
    12,749

    Re: Cell Reference returns error

    You're welcome...glad I could help. Thanks for the Rep.

+ 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] How to See Hard Returns in a Reference to a Cell
    By whdyck in forum Excel Formulas & Functions
    Replies: 8
    Last Post: 01-21-2015, 03:24 AM
  2. [SOLVED] How to fix a vba code that returns a cell reference
    By Mr_Bill in forum Excel Programming / VBA / Macros
    Replies: 24
    Last Post: 09-28-2014, 10:59 AM
  3. Is there function that returns MIN (or MAX) cell reference
    By riwiseuse in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 04-20-2014, 10:12 AM
  4. [SOLVED] formula returns a #VALUE! error if no value in reference cell???
    By ciapul12 in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 01-12-2014, 05:39 PM
  5. Excel 2007 : Reference returns cell address - not data
    By Martin Snerl in forum Excel General
    Replies: 2
    Last Post: 01-15-2010, 05:23 AM

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