+ Reply to Thread
Results 1 to 5 of 5

Double click to insert new row, only on specific cells (They all say "Add Line")

  1. #1
    Registered User
    Join Date
    02-18-2019
    Location
    London
    MS-Off Ver
    Microsoft Office 365 ProPlus
    Posts
    3

    Double click to insert new row, only on specific cells (They all say "Add Line")

    Good day all.

    I am working on a spreadsheet which will enable me to track where my built systems are, and am hoping to make it a bit more user-friendly for future users.

    In the attached file there is a table. Column A has the Product type, column B has the product name (each of the products will have a unique identifier), columns C and D are the versions of hardware and software, column E will change each time, and column F (location to track product) is manually edited.

    What I am hoping to achieve is the ability to add a line if someone clicks the 'Add Line' cells which are in column A. I have seen a few examples where people add a row above a specific cell, and I tried to edit it so that it would occur to the 'active cell' and that it would be started by a double click, but have had no such luck. My issue is that this is my first time attempting anything with VBA, and I don't have much of a programming background at all. It's been quite fun so far, though, so I am looking forward to learning more!

    I have got my pseudo code to assist any willing to help:

    // User input:
    // Double Click
    //
    // VBA actions:
    // Check if cell has "Add Line" in it.
    // If it does:
    // Select active cell,
    // Insert row above active cell,
    // Copy format from line above inserted row into new row (including the Thing numbers (T1, T2) which increment, and the cell colour).
    //
    // If it does not:
    // Ignore.

    Thank you in advance!
    Chris.
    Attached Files Attached Files

  2. #2
    Forum Contributor banaanas's Avatar
    Join Date
    08-26-2014
    Location
    Finland
    MS-Off Ver
    2016
    Posts
    199

    Re: Double click to insert new row, only on specific cells (They all say "Add Line")

    Add this code to the Worksheet Code, or download my attachment
    Please Login or Register  to view this content.
    Attached Files Attached Files
    Tuomas "Banaanas" Savonius
    Trying to give back now when I actually can do some VBA

  3. #3
    Registered User
    Join Date
    02-18-2019
    Location
    London
    MS-Off Ver
    Microsoft Office 365 ProPlus
    Posts
    3

    Re: Double click to insert new row, only on specific cells (They all say "Add Line")

    Hi Banaanas,

    Thank you very much for your reply! Your code does exactly what I asked, which is probably where I went wrong haha

    The overall function is perfect, so thank you for that. Is there anyway, though, to not increment columns A, C, D, E, and F. i.e. Only increment column B?

    Sorry to be a pain!

    Thank you again.

  4. #4
    Forum Contributor banaanas's Avatar
    Join Date
    08-26-2014
    Location
    Finland
    MS-Off Ver
    2016
    Posts
    199

    Re: Double click to insert new row, only on specific cells (They all say "Add Line")

    Sure:

    Please Login or Register  to view this content.

  5. #5
    Registered User
    Join Date
    02-18-2019
    Location
    London
    MS-Off Ver
    Microsoft Office 365 ProPlus
    Posts
    3

    Re: Double click to insert new row, only on specific cells (They all say "Add Line")

    Again, thank you very much. Your help has been greatly appreciated

    Hopefully one day I can repay the favour!

    Chris

+ 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] Double Click one sheet and replicate Double Click "mark" on other sheets
    By jeffreybrown in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 12-14-2018, 08:43 AM
  2. [SOLVED] "X" on Double-Click, Merged Cell...but only on specific Worksheet.
    By KomicJ in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 01-26-2018, 05:14 PM
  3. Toggle BackColor of labels in Userform through "click" and "double-click"
    By ahmerjaved in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 03-20-2013, 02:08 PM
  4. [SOLVED] Disable "Right Click" ... or any ability to "cut", "insert", etc.
    By jonvanwyk in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 06-23-2011, 09:26 AM
  5. Double Click in Merged Cells to insert and delete an "X"
    By Ripperdan in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 01-16-2010, 10:07 AM
  6. [SOLVED] Excel: can "go to adjacent empty cell" double-click be disabled?
    By dgg2006 in forum Excel General
    Replies: 1
    Last Post: 04-07-2006, 11:55 PM
  7. [SOLVED] excel status bar says "double-click to edit PBrush"
    By leo in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 04-07-2006, 11:10 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