+ Reply to Thread
Results 1 to 6 of 6

Get row number of first empty cell in column and store that value in other cell

  1. #1
    Registered User
    Join Date
    09-09-2007
    Posts
    4

    Exclamation Get row number of first empty cell in column and store that value in other cell

    I want to find row number of first empty cell in column and store that row number in Cell Z1.

    I tried with Following macro code but it goes into loop forever. As soon as it tries to set the value in Cell Z1 it again goes into worksheet_change event again and then again in for loop.

    Please Login or Register  to view this content.
    Please help to resolve this.

    Thanks

  2. #2
    Forum Expert
    Join Date
    12-24-2007
    Location
    Alsace - France
    MS-Off Ver
    MS 365 Office Suite
    Posts
    5,066

    Re: Get row number of first empty cell in column and store that value in other cell

    See next code
    Please Login or Register  to view this content.
    - Battle without fear gives no glory - Just try

  3. #3
    Forum Expert
    Join Date
    11-24-2013
    Location
    Paris, France
    MS-Off Ver
    Excel 2003 / 2010
    Posts
    9,831

    Re: Get row number of first empty cell in column and store that value in other cell

    (removed as too late)

  4. #4
    Registered User
    Join Date
    09-09-2007
    Posts
    4

    Re: Get row number of first empty cell in column and store that value in other cell

    No, this is not working as required.

    I want to find first empty cell in given column, and that cell address (or just the row number) should be automatically typed to cell Z1.

    for e.g

    P1 = "ABC"
    P2 = "XYZ"
    P3 = "PQR"
    P4 = (cell is empty)

    So cell Z1 value should be set to 4 or P4. It should check and set on every worksheet_change event.


    Quote Originally Posted by PCI View Post
    See next code
    Please Login or Register  to view this content.

  5. #5
    Registered User
    Join Date
    09-09-2007
    Posts
    4

    Re: Get row number of first empty cell in column and store that value in other cell

    sample screenshot attached

    Attachment 675865

  6. #6
    Forum Expert
    Join Date
    12-24-2007
    Location
    Alsace - France
    MS-Off Ver
    MS 365 Office Suite
    Posts
    5,066

    Re: Get row number of first empty cell in column and store that value in other cell

    Yes it is working but in your code example you were using column 12 for "L"
    Use next code

    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. Move last cell in column to the next right empty cell if row in sheet is empty
    By Daijhan97 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 08-23-2019, 07:05 AM
  2. [SOLVED] Store a cell's value to a new row in a specific column every time that cell changes
    By esein in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 01-10-2018, 03:32 AM
  3. [SOLVED] Count number of empty cells and sum up too the first non-empty cell.
    By CraftyGamer in forum Excel Formulas & Functions
    Replies: 11
    Last Post: 11-28-2017, 11:35 AM
  4. Replies: 10
    Last Post: 09-26-2015, 08:26 PM
  5. [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
  6. Excel VBA evaluate if Cell in column D is empty and Cell in column A is not empty
    By Jovillanueva in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 09-02-2014, 08:09 PM
  7. Automatic change number of cell and store results
    By keis386 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 08-11-2012, 09:57 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