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!
Any thoughts?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
Last edited by AldenH123; 12-13-2010 at 10:41 AM. Reason: Complying with forum Rule 3
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)
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks