Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Creating a Macro that enters data under last row that data was entered

Status
Not open for further replies.

tonybarr007

Technical User
Jun 13, 2007
3
US
Below is the current code, It works fine for the first line but I am unaware of how to specify the range that rather than being "A3:H3" it will copy the data from Sheet 2 "B2:B9" and insert into the next row. please help.

Sub Macro1()
'
' Macro1 Macro
' Macro recorded 6/12/2007 by Anthony Barr
'
' Keyboard Shortcut: Ctrl+r
'
Range("B2:B9").Select
Selection.Copy
Sheets("Sheet4").Select
Range("A3:H3").Select
Selection.PasteSpecial Paste:=xlPasteValuesAndNumberFormats, Operation:= _
xlNone, SkipBlanks:=False, Transpose:=True
Sheets("Sheet2").Select
Application.CutCopyMode = False
Selection.ClearContents
End Sub
 
At least 2 FAQs in this forum for retrieving the last populated row ...

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top