+ Reply to Thread
Results 1 to 6 of 6

Copy to blank row modification required

  1. #1
    Forum Contributor
    Join Date
    11-03-2012
    Location
    England
    MS-Off Ver
    Excel 2010
    Posts
    246

    Copy to blank row modification required

    Hi,

    I use the following code to copy cells from 1 sheet to another into the next blank row.

    I would like to code to run as is but go to the row where the copied cells are pasted in to.

    Please Login or Register  to view this content.
    Sub Inv_1_Acc_In_1()
    Application.ScreenUpdating = False
    Dim destRange As Range
    Dim aRow As Range
    For Each aRow In Sheets("Accounts").Range("C5:L39,C55:L89,C105:L139,C155:L189,C205:L239,C255:L289,C305:L339,C355:L389,C405:L439,C455:L489,C505:L539,C555:L589").Rows
    If Application.CountA(aRow) = 0 Then
    Sheets("Inv 1").Range("Y8:AG8").Copy
    aRow.Cells(1).PasteSpecial xlPasteValues
    Application.CutCopyMode = False
    Application.ScreenUpdating = False
    Exit For
    End If
    Next
    End Sub
    Please Login or Register  to view this content.

  2. #2
    Forum Expert sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2016 | 2019
    Posts
    13,210

    Re: Copy to blank row modification required

    Please Login or Register  to view this content.
    before
    Please Login or Register  to view this content.
    Good Luck
    I don't presume to know what I am doing, however, just like you, I too started somewhere...
    One-day, One-problem at a time!!!
    If you feel I have helped, please click on the star to left of post [Add Reputation]
    Also....add a comment if you like!!!!
    And remember...Mark Thread as Solved.
    Excel Forum Rocks!!!

  3. #3
    Forum Contributor
    Join Date
    11-03-2012
    Location
    England
    MS-Off Ver
    Excel 2010
    Posts
    246

    Re: Copy to blank row modification required

    Thanks for your reply,

    I get the following error when the additional line is inserted.

    Run-time error '1004:

    Activate method of Range class failed

  4. #4
    Forum Expert sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2016 | 2019
    Posts
    13,210

    Re: Copy to blank row modification required

    Here you go:
    Please Login or Register  to view this content.

  5. #5
    Forum Contributor
    Join Date
    11-03-2012
    Location
    England
    MS-Off Ver
    Excel 2010
    Posts
    246

    Re: Copy to blank row modification required

    That's the one, Many thanks :-)

  6. #6
    Forum Expert sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2016 | 2019
    Posts
    13,210

    Re: Copy to blank row modification required

    Pleasure. thanks for rep points....Please mark thread as solved.
    In future please view the forum rules before posting. Your post does not comply with rule #3.
    3. Use code tags around code. Posting code without them makes your code hard to read and difficult to be copied for testing. Highlight your code and click the [#] button at the top of the post window.

+ 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] Save Sheet to Pdf, then email. Modification to macro required please
    By A440 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-16-2017, 06:42 PM
  2. [SOLVED] Simple Conditional Formating Help Required - If Blank then Red Bold text required
    By thilag in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 12-19-2014, 12:23 PM
  3. Replies: 2
    Last Post: 05-26-2014, 12:30 AM
  4. Replies: 6
    Last Post: 11-05-2013, 02:22 AM
  5. [SOLVED] Modification required in vba code.
    By satputenandkumar0 in forum Excel Programming / VBA / Macros
    Replies: 12
    Last Post: 07-01-2013, 07:12 AM
  6. [SOLVED] Macro modification required (very small)
    By nur2544 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 12-21-2012, 01:34 PM
  7. Modification required in the code line which finds the Last column
    By acsishere in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 07-25-2008, 03:54 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