+ Reply to Thread
Results 1 to 7 of 7

VBA to find last cell in column

  1. #1
    Forum Contributor
    Join Date
    02-20-2014
    Location
    Ireland
    MS-Off Ver
    Excel 2013
    Posts
    108

    VBA to find last cell in column

    Hi All,

    New enough to this VBA, I am trying to copy the last row of data in column A and paste it to another workbook

    I am currently using this bit of code

    Please Login or Register  to view this content.
    This code runs but I cant tell where it is referencing as it keeps returning blank, and the cell i want isn't blank. I have been messing with the Offset and xlUp and xlDown but to no avail.

    Hope somebody can help me

    Simon

  2. #2
    Valued Forum Contributor Hawkeye16's Avatar
    Join Date
    02-27-2013
    Location
    Holland
    MS-Off Ver
    ├•┤ Pew Pew
    Posts
    441

    Re: VBA to find last cell in column

    Take out the .Offset(1) and it should work

    You could also use the .specialcells(xllastcell) as I have seen on here a few times but I am less familiar with that approach, may take trial and error.
    Last edited by Hawkeye16; 07-08-2014 at 07:21 AM.
    Despite the high cost of living, it remains very popular.

    Don't forget to mark threads SOLVED when you get an answer and rep all the geniouses that helped you today!

  3. #3
    Forum Contributor
    Join Date
    02-20-2014
    Location
    Ireland
    MS-Off Ver
    Excel 2013
    Posts
    108

    Re: VBA to find last cell in column

    I had tried that but It still returns a blank, I had originally put the offset in as i thought it might be returning the blank cell just below the last cell with a value. but still no joy

  4. #4
    Valued Forum Contributor Hawkeye16's Avatar
    Join Date
    02-27-2013
    Location
    Holland
    MS-Off Ver
    ├•┤ Pew Pew
    Posts
    441

    Re: VBA to find last cell in column

    That should work. To help dubug you can put a statement like this is right after the copy statement to make sure it is working correctly or see what the issue is.

    Please Login or Register  to view this content.

  5. #5
    Forum Expert
    Join Date
    06-12-2012
    Location
    Ridgefield Park, New Jersey
    MS-Off Ver
    Excel 2003,2007,2010
    Posts
    10,241

    Re: VBA to find last cell in column

    Maybe:

    Please Login or Register  to view this content.

  6. #6
    Forum Contributor
    Join Date
    02-20-2014
    Location
    Ireland
    MS-Off Ver
    Excel 2013
    Posts
    108

    Re: VBA to find last cell in column

    Thanks Hawkeye, That bit of debugging made it very clear what the issue was, there are formulas in column A so it was returning the last cell with a formula in it, which was returning blank.

    I will simply use column C and an offset.

    Thanks for your help. Rep Added

  7. #7
    Valued Forum Contributor Hawkeye16's Avatar
    Join Date
    02-27-2013
    Location
    Holland
    MS-Off Ver
    ├•┤ Pew Pew
    Posts
    441

    Re: VBA to find last cell in column

    No problem, 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. Find 1st unique Value on Column and Insert certain Word on cell on left Column
    By Wldlife23 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 08-16-2013, 10:02 AM
  2. [SOLVED] Macro to find the empty cell in a column and copy a adjacent row to another column.
    By naga in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 07-18-2013, 07:44 AM
  3. macro to find first blank cell in a column cut the value from left adjacent column
    By willykin in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 01-01-2012, 09:23 AM
  4. Range.Find to find column and place value in next available cell in one line
    By davegugg in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 09-02-2011, 10:41 AM
  5. Replies: 8
    Last Post: 08-06-2009, 09:02 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