+ Reply to Thread
Results 1 to 13 of 13

Copy Active Cell Row and insert below Active Cell Row

  1. #1
    Forum Contributor
    Join Date
    10-24-2012
    Location
    Chicago
    MS-Off Ver
    O365
    Posts
    311

    Copy Active Cell Row and insert below Active Cell Row

    Hello,

    I have the following code in a workbook. I want it to select the row that the cursor is in and copy it. Then select the row right below that active cell and insert the active row that was copied. Then input a formula in cell C of that newly inserted row. When the formula is done to select that newly inserted formula in column C of that row and paste value it. I am testing it out and I sometimes get a debug error and when I stop the debug I can no longer select any cells or rows in the excel workbook. I have to completely shutdown the workbook and reopen it to be able to select rows or cells again. Any idea why that is? Weird right? The code I am messing with is below.

    Please Login or Register  to view this content.

  2. #2
    Forum Expert gmr4evr1's Avatar
    Join Date
    11-24-2014
    Location
    Texas
    MS-Off Ver
    Office 2010 and 2007
    Posts
    3,448

    Re: Copy Active Cell Row and insert below Active Cell Row

    Remove Value from
    Please Login or Register  to view this content.
    See if that works. I tested it with it there and kept getting an error, when I remove the word Value from that line, the code ran without errors.
    1N73LL1G3NC3 15 7H3 4B1L17Y 70 4D4P7 70 CH4NG3 - 573PH3N H4WK1NG
    You don't have to add Rep if I have helped you out (but it would be nice), but please mark the thread as SOLVED if your issue is resolved.

    Tom

  3. #3
    Forum Expert skywriter's Avatar
    Join Date
    06-09-2014
    Location
    USA
    MS-Off Ver
    2016
    Posts
    2,760

    Re: Copy Active Cell Row and insert below Active Cell Row

    Try this.

    Please Login or Register  to view this content.
    Click the * Add Reputation button in the lower left hand corner of this post to say thanks.

    Don't forget to mark this thread SOLVED by going to the "Thread Tools" drop down list above your first post and choosing solved.

  4. #4
    Forum Contributor
    Join Date
    10-24-2012
    Location
    Chicago
    MS-Off Ver
    O365
    Posts
    311

    Re: Copy Active Cell Row and insert below Active Cell Row

    to Skywriter - The macro debugs at insert shift:=x1Up. It debugs there but in the worksheet it does add the second row. It just doesn't complete the steps in the code for the formulas. Not sure why it stops there even though it performs the step on the sheet itself.

  5. #5
    Forum Contributor
    Join Date
    10-24-2012
    Location
    Chicago
    MS-Off Ver
    O365
    Posts
    311

    Re: Copy Active Cell Row and insert below Active Cell Row

    I am also still getting the issue where after the macro runs and debugs. I stop the debug and it doesn't allow me to select a cell in the worksheet. It allows me to double click a cell to change a formula etc. but I cannot select a cell. I then have to shut excel down and reopen to be able to select cells again.

    Automation error The object invoked has disconnected from its clients
    Last edited by amartin575; 07-01-2015 at 10:41 AM.

  6. #6
    Forum Expert
    Join Date
    07-31-2010
    Location
    California
    MS-Off Ver
    Excel 2007
    Posts
    4,070

    Re: Copy Active Cell Row and insert below Active Cell Row

    Please Login or Register  to view this content.

  7. #7
    Forum Expert
    Join Date
    06-12-2012
    Location
    Ridgefield Park, New Jersey
    MS-Off Ver
    Excel 2003,2007,2010
    Posts
    10,241

    Re: Copy Active Cell Row and insert below Active Cell Row

    Maybe:

    Please Login or Register  to view this content.

  8. #8
    Forum Contributor
    Join Date
    10-24-2012
    Location
    Chicago
    MS-Off Ver
    O365
    Posts
    311

    Re: Copy Active Cell Row and insert below Active Cell Row

    I changed the code to the following and still got the bug on the .Offset(1).Insert

    Please Login or Register  to view this content.

  9. #9
    Forum Contributor
    Join Date
    10-24-2012
    Location
    Chicago
    MS-Off Ver
    O365
    Posts
    311

    Re: Copy Active Cell Row and insert below Active Cell Row

    the file is attached here.
    Attached Files Attached Files

  10. #10
    Forum Contributor
    Join Date
    10-24-2012
    Location
    Chicago
    MS-Off Ver
    O365
    Posts
    311

    Re: Copy Active Cell Row and insert below Active Cell Row

    the AccrualOffset code is where the issue lies. I want them to insert one side of the entry and while in that active row hit the Accrual Offset code and it books the other side of the entry

  11. #11
    Forum Contributor
    Join Date
    10-24-2012
    Location
    Chicago
    MS-Off Ver
    O365
    Posts
    311

    Re: Copy Active Cell Row and insert below Active Cell Row

    just following up. any ideas what could be the issue?

  12. #12
    Forum Contributor
    Join Date
    10-24-2012
    Location
    Chicago
    MS-Off Ver
    O365
    Posts
    311

    Re: Copy Active Cell Row and insert below Active Cell Row

    Where'd everyone go?

  13. #13
    Forum Contributor
    Join Date
    10-24-2012
    Location
    Chicago
    MS-Off Ver
    O365
    Posts
    311

    Re: Copy Active Cell Row and insert below Active Cell Row

    Bueller....Bueller....

+ 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. Problems with autofilling formula down the active column to the end row using active cell
    By sl_riches2179 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 11-27-2013, 09:30 AM
  2. Replies: 2
    Last Post: 12-23-2012, 09:26 AM
  3. Replies: 1
    Last Post: 07-08-2012, 08:47 AM
  4. [SOLVED] VBA - Can I select a new active cell based on the value of the current active cell?
    By GrumpyOldBastard in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 02-08-2012, 07:05 PM
  5. Copy from active sheet and paste into new sheet using info from cell in active
    By Ingve in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 01-23-2006, 06:00 PM

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