+ Reply to Thread
Results 1 to 9 of 9

Inserting a new row creates a blank in a cell that identifies row's alphabetical placement

  1. #1
    Registered User
    Join Date
    10-27-2014
    Location
    Glencoe, Illinois
    MS-Off Ver
    Office 365 2016
    Posts
    11

    Question Inserting a new row creates a blank in a cell that identifies row's alphabetical placement

    Hello All:

    I have a column that identifies where each row stands based on the alphabetical last name entry. When I add a new name to the list, the cell in that column is blank. Is there a way to have it automatically populate that cell with the next number in sequence and adjust all subsequent rows?

    Further, what happens if I sort the data in some other order than alphabetical?

    Call me puzzled!

    Thanks for any assistance.

    Jerry Scherer

  2. #2
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Inserting a new row creates a blank in a cell that identifies row's alphabetical place

    Hi Jerry,

    I'm struggling to visualise exactly what you mean. You'll need to upload the workbook and indicate what name you add, where and what you expect to see elsewhere.
    Richard Buttrey

    RIP - d. 06/10/2022

    If any of the responses have helped then please consider rating them by clicking the small star icon below the post.

  3. #3
    Registered User
    Join Date
    10-27-2014
    Location
    Glencoe, Illinois
    MS-Off Ver
    Office 365 2016
    Posts
    11

    Re: Inserting a new row creates a blank in a cell that identifies row's alphabetical place

    Thanks for your note. I am attaching a sample of what I am trying to accomplish. See if that helps.
    Attached Files Attached Files

  4. #4
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Inserting a new row creates a blank in a cell that identifies row's alphabetical place

    Hi,

    Put this formula in D3 and copy down
    Formula: copy to clipboard
    Please Login or Register  to view this content.


    Now add the following Double Click Event Macro

    Please Login or Register  to view this content.
    Whenever you double click a row it will insert a new row and add the formula for you.

    The other option is to first add the formulae and then convert the range into a TABLE. Then whenever you manually insert a row the formula will be copied automatically.

  5. #5
    Registered User
    Join Date
    10-27-2014
    Location
    Glencoe, Illinois
    MS-Off Ver
    Office 365 2016
    Posts
    11

    Re: Inserting a new row creates a blank in a cell that identifies row's alphabetical place

    Thank you very much. How do I tell Excel that this Macro exists in this workbook? Also, I still have concerns about what happens if I sort the data by something other than Last Name.

  6. #6
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Inserting a new row creates a blank in a cell that identifies row's alphabetical place

    Hi,

    Right click the sheet tab name, Select View Code, in the left had drop down over on the right choose Worksheet, in the right hand drop down choose the BeforeDoubleClick procedure and add the code there.

    However you sort the data the column with the formula will always contain incremental numbers.

  7. #7
    Registered User
    Join Date
    10-27-2014
    Location
    Glencoe, Illinois
    MS-Off Ver
    Office 365 2016
    Posts
    11

    Re: Inserting a new row creates a blank in a cell that identifies row's alphabetical place

    Richard, you have been more than helpful. However, I still can't seem to get this right. The attached is a screen shot of what happens when I try to save the VB file. Am I doing something wrong? Also, note that the macro code does not appear.
    Attached Images Attached Images

  8. #8
    Forum Expert
    Join Date
    12-11-2011
    Location
    Netherlands
    MS-Off Ver
    office 365
    Posts
    3,293

    Re: Inserting a new row creates a blank in a cell that identifies row's alphabetical place

    xlsx files cannot contain any macro
    Save the file as .xlsm and not as xlsx
    Willem
    English is not my native language sorry for errors
    Please correct me if I'm completely wrong

  9. #9
    Registered User
    Join Date
    10-27-2014
    Location
    Glencoe, Illinois
    MS-Off Ver
    Office 365 2016
    Posts
    11

    Re: Inserting a new row creates a blank in a cell that identifies row's alphabetical place

    Thank you all for your contributions. Very much appreciated.

+ 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. Replies: 4
    Last Post: 08-06-2015, 07:06 AM
  2. Replies: 3
    Last Post: 10-29-2013, 12:06 AM
  3. Select a specific column till it identifies blank cell and to format
    By k1234y in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 04-28-2012, 12:35 AM
  4. Need help inserting text into ever 7th (blank) cell.
    By deenix in forum Excel General
    Replies: 2
    Last Post: 08-26-2011, 03:17 PM
  5. inserting date in next available blank cell
    By st0kvis in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 05-12-2011, 05:43 AM
  6. Inserting blank cell
    By satishyadav in forum Excel - New Users/Basics
    Replies: 0
    Last Post: 05-20-2010, 06:44 AM
  7. [SOLVED] Imported Data creates blank cells that aren't really blank
    By JackieD in forum Excel Formulas & Functions
    Replies: 14
    Last Post: 02-22-2006, 09:00 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