+ Reply to Thread
Results 1 to 5 of 5

last non-empty cell

  1. #1
    Forum Contributor
    Join Date
    11-09-2012
    Location
    United Kingdom
    MS-Off Ver
    Excel 2013
    Posts
    390

    last non-empty cell

    Hi,

    I have range of dates in column A and times in rest of columna. Cell B5 is 00:00, I am looking for a VBA code to take the last value of row 5 and add 00:30 to it until 24 hours. i.e. C5 to be 00:30, D5 to be 01:00, E5 to be 01:30 and so on until AW5 to be 23:30.

    Any help much appreciated.

    Thanks,

  2. #2
    Forum Expert Olly's Avatar
    Join Date
    09-10-2013
    Location
    Darlington, UK
    MS-Off Ver
    Excel 2016, 2019, 365
    Posts
    6,284

    Re: last non-empty cell

    It's not quite clear exactly what you want... do you want to repeat this for all rows which have a date in column A, or only row 5? Do you need to find the position of the last cell in each row, or the position of 00:00?

    It might be easier to demonstrate what you are trying to achieve if you attach a sample workbook. Make sure there is just enough data to demonstrate your need. Include a BEFORE sheet and an AFTER sheet in the workbook if needed to show the process you're trying to complete or automate. Make sure your desired results are shown, mock them up manually if necessary.

    Remember to desensitize the data.

    Click on GO ADVANCED and then scroll down to Manage Attachments to open the upload window.
    let Source = #table({"Question","Thread", "User"},{{"Answered","Mark Solved", "Add Reputation"}}) in Source

    If I give you Power Query (Get & Transform Data) code, and you don't know what to do with it, then CLICK HERE

    Walking the tightrope between genius and eejit...

  3. #3
    Forum Contributor
    Join Date
    11-09-2012
    Location
    United Kingdom
    MS-Off Ver
    Excel 2013
    Posts
    390

    Re: last non-empty cell

    Hi,

    I have attached the before and after sheets for better understanding.

    Thanks,

    Quote Originally Posted by Olly View Post
    It's not quite clear exactly what you want... do you want to repeat this for all rows which have a date in column A, or only row 5? Do you need to find the position of the last cell in each row, or the position of 00:00?

    It might be easier to demonstrate what you are trying to achieve if you attach a sample workbook. Make sure there is just enough data to demonstrate your need. Include a BEFORE sheet and an AFTER sheet in the workbook if needed to show the process you're trying to complete or automate. Make sure your desired results are shown, mock them up manually if necessary.

    Remember to desensitize the data.

    Click on GO ADVANCED and then scroll down to Manage Attachments to open the upload window.
    Attached Files Attached Files

  4. #4
    Forum Expert Olly's Avatar
    Join Date
    09-10-2013
    Location
    Darlington, UK
    MS-Off Ver
    Excel 2016, 2019, 365
    Posts
    6,284

    Re: last non-empty cell

    Try:
    Please Login or Register  to view this content.

  5. #5
    Forum Contributor
    Join Date
    11-09-2012
    Location
    United Kingdom
    MS-Off Ver
    Excel 2013
    Posts
    390

    Re: last non-empty cell

    Perfect! thanks alot
    Quote Originally Posted by Olly View Post
    Try:
    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)

Similar Threads

  1. [SOLVED] Paste formula to the last empty cell based on a non-empty cell on another column
    By bhenlee in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 04-02-2015, 04:07 PM
  2. [SOLVED] excel 2010 empty a cell according to other cells (without Deleting them just show empty)
    By pavlos_x in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 02-11-2015, 01:46 PM
  3. Replies: 1
    Last Post: 05-26-2014, 01:31 PM
  4. Replies: 5
    Last Post: 05-13-2014, 10:19 AM
  5. Need to find empty filled cells in a column and copy to the empty cell below
    By Grahamfeeley in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 03-30-2014, 10:09 AM
  6. MACRO to empty a range of cells based on whether specified cell is empty
    By TBJV in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 05-01-2013, 10:35 PM
  7. [SOLVED] still have empty cell after run Delete empty cells code
    By tuongtu3 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 11-25-2012, 04:28 PM

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