+ Reply to Thread
Results 1 to 2 of 2

Thread: copy to next available row

  1. #1
    Registered User
    Join Date
    12-07-2010
    Location
    Belfast
    MS-Off Ver
    Excel 2003
    Posts
    4

    Question copy to next available row

    Hi,

    I've set up an invoice and want to be able to copy the data to the next available row in another worksheet.

    I've assigned the macro to a Command Button.

    Specific cells in the invoice are linked to a worksheet from where the macro copies and pastes into the Sales Ledger

    Except that only the copy part works... it doesn't select the next blank line!


    Sub copyinvoicedatatosalesledger()
    '
    ' copyinvoicedatatosalesledger Macro
    '
    ' Keyboard Shortcut: Ctrl+q
    '
    Application.ScreenUpdating = False
    If Range("A2") <> "" Then
    Selection.End(xlDown).Select

    End If
    Sheets("Sales Ledger").Select
    Range("I2:N6").Select
    Selection.CurrentRegion.Select
    ActiveCell.Offset(1, 0).Range("A1").Select
    Range("I2:N6").Select
    Selection.Copy
    ActiveWindow.SmallScroll ToRight:=-2
    Range("A2:F6").Select
    Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
    :=False, Transpose:=False
    End Sub
    Any thoughts?
    Last edited by AldenH123; 12-13-2010 at 10:41 AM. Reason: Complying with forum Rule 3

  2. #2
    Forum Guru, retired Admin royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    25,639

    Re: copy to next available row

    Your post does not comply with Rule 3 of our Forum RULES. 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 # at the top of your post window. For more information about these and other tags, found here

    This must have been covered several thousand times, so the forum search should find it
    Hope that helps.

    RoyUK
    --------
    If you are pleased with a member's answer then use the Star icon to rate it, if you are pleased enough to part with cash consider a donation to Children in Need

    For Excel Tips & Solutions, free examples and tutorials why not check out my downloads

    New members please read & follow the Forum Rules

    Remember to mark your questions Solved and rate the answer(s)

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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.2.0