+ Reply to Thread
Results 1 to 9 of 9

Copy cells up one row

  1. #1
    Registered User
    Join Date
    04-24-2004
    Location
    Wisconsin, USA
    MS-Off Ver
    2007
    Posts
    70

    Copy cells up one row

    Is there a way to suspend an Excel macro until you press Enter?

    I’m attempting to create a macro that copies numerous cells up one row. I have the routine working fine except it always defaults to the same starting position/copy to position. However, the original location to begin the routine changes. I believe I need the macro to pause while I place the cursor in the correct location to begin the routine. Any suggestions would be appreciated.

    Here is the code that works except it always starts at cell L16 and always copies to cell L15.
    1. I want to be able to place the cursor on the correct starting cell in column “L”
    2. Copy all cells from the starting cell to the right two columns
    3. Paste all cells up one row
    In other words I want to remove the data in the three cells starting where I place the cursor


    Please Login or Register  to view this content.
    Thanks,
    Steve K.
    Last edited by esskaykay; 11-25-2020 at 10:52 AM. Reason: Easier to read

  2. #2
    Forum Expert Logit's Avatar
    Join Date
    12-23-2012
    Location
    North Carolina
    MS-Off Ver
    Excel 2019 Professional Plus - 2007 Enterprise
    Posts
    6,986

    Re: Copy cells up one row

    .
    The following - in its present form - is not an answer to your problem. HOWEVER, if you paste this macro
    into a separate workbook and use it / study the code ... you will soon understand how you can implement
    this macro in your current project to solve your posted issue.

    Please Login or Register  to view this content.

  3. #3
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,465

    Re: Copy cells up one row

    esskaykay,

    1) Cose tags are missing

    Please see Forum Rule #2 about code tags and adjust accordingly. Click on Edit to open your post, then highlight your code and click the # icon at the top of your post window. More information about these and other tags can be found here

    [code]Please [url=https://www.excelforum.com/login.php]Login or Register [/url] to view this content.[/code]

    2) Change to
    Please Login or Register  to view this content.

  4. #4
    Registered User
    Join Date
    04-24-2004
    Location
    Wisconsin, USA
    MS-Off Ver
    2007
    Posts
    70

    Re: Copy cells up one row

    Thank you both for your quick response. I have tried these but I’m still not getting what I was hoping for. I probably explained my request wrong. I think I can simplify my issue.

    I want a routine that prompts me to highlight a cell in column “L” where I want to delete data from that cell plus the two adjacent cells to the right; then move all data below that up one row.

    Example – If I highlight cell L17 it deletes all data in cells L17:N17. After deletion I want all data below the deleted row in columns L-N to be moved up one row. In other words I don’t really need to delete the data in row 17 but simply move all data below it up one row (i.e., range L18:N1000). Now if I highlighted cell L123 it would move all data from L124:N1000 up to row 123.

    I’m not sure if this helps explain what I have in mind. Again, I am very appreciative of your help.

    SKK

  5. #5
    Forum Expert Logit's Avatar
    Join Date
    12-23-2012
    Location
    North Carolina
    MS-Off Ver
    Excel 2019 Professional Plus - 2007 Enterprise
    Posts
    6,986

    Re: Copy cells up one row

    .
    Select a cell in Col L, then run this macro :

    Please Login or Register  to view this content.

  6. #6
    Registered User
    Join Date
    04-24-2004
    Location
    Wisconsin, USA
    MS-Off Ver
    2007
    Posts
    70

    Re: Copy cells up one row

    Thank you Logit that does what I’m looking for.

    Without being too much of a bother here, I have one other request if you don't mind. Is it possible for the routine to prompt the user to select the cell after the macro executes? In other words something like a prompt that asks the user to select the cell then press Enter (or click OK or something) and the routine completes the action.

    Steve K.
    Last edited by esskaykay; 11-25-2020 at 01:26 PM. Reason: Mistake

  7. #7
    Forum Expert Logit's Avatar
    Join Date
    12-23-2012
    Location
    North Carolina
    MS-Off Ver
    Excel 2019 Professional Plus - 2007 Enterprise
    Posts
    6,986

    Re: Copy cells up one row

    .
    Please Login or Register  to view this content.

  8. #8
    Registered User
    Join Date
    04-24-2004
    Location
    Wisconsin, USA
    MS-Off Ver
    2007
    Posts
    70

    Re: Copy cells up one row

    EXCELLENT - works perfect.

    Thank you very much Logit and much appreciated,
    Steve

  9. #9
    Forum Expert Logit's Avatar
    Join Date
    12-23-2012
    Location
    North Carolina
    MS-Off Ver
    Excel 2019 Professional Plus - 2007 Enterprise
    Posts
    6,986

    Re: Copy cells up one row

    You are welcome.

    Cheers !

+ 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] Copy data range but ignore (not copy) cells with formula
    By mattman1968 in forum Excel Programming / VBA / Macros
    Replies: 19
    Last Post: 03-25-2019, 06:00 PM
  2. copy the intersection of selected cells and past delimition then copy results to another
    By hassan khansa in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 08-07-2017, 04:57 PM
  3. Alter existing formula to copy specific cells in row instead of copy entire column
    By painterartist in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 05-02-2014, 12:42 PM
  4. Replies: 8
    Last Post: 07-08-2013, 06:03 AM
  5. [SOLVED] VBA to Copy set data, paste into set cells, then copy more & set into cells related 2 date
    By galvinpaddy in forum Excel Programming / VBA / Macros
    Replies: 99
    Last Post: 02-01-2013, 08:43 AM
  6. [SOLVED] can only copy/select visible cells w autofilter on &hidden columns, want to copy all cells
    By JTwrk in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 05-25-2012, 02:12 AM
  7. Replies: 10
    Last Post: 03-02-2006, 06:50 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