Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Insert a row then copy a transaction
Hello gurus, Can somebody show me how to create a macro/script that would insert a row in a worksheet (Sheet1) and then copy the top row of another worksheet (Sheet2) into the inserted row? The copying needs to triggered manually. We have a 4 copy pre-printed form that we use a dot matrix to print to it and I made an Excel template where the clerk can enter the data and then just hit print. I am trying to capture the data that the clerk types in and create a database so we'll a searchable computer record. If inserting the data in a row is not possible, how about exporting a row and appending it on a text file? Thanks in advance. -- ledzepe ------------------------------------------------------------------------ ledzepe's Profile: http://www.excelforum.com/member.php...o&userid=25207 View this thread: http://www.excelforum.com/showthread...hreadid=386957 |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Insert a row then copy a transaction
You didn't say where you want to insert the row but I have assumed at row 2
(just below headings). Sub CopyOver() Sheets("Sheet1").Range("A2").EntireRow.Insert Sheets("Sheet2").Rows("1:1").Copy _ Destination:=Sheets("Sheet1").Rows("2:2") End Sub Alternately, you may just want to copy the data to the first row which does not allready have data in column A (i.e. the first blank row): Sub CopyOver() Dim endRow As Long endRow = Sheets("Sheet1").Cells(Rows.Count, 1).End(xlUp).Row + 1 Sheets("Sheet2").Rows("1:1").Copy _ Destination:=Sheets("Sheet1").Rows(endRow & ":" & endRow) End Sub Hope this helps Rowan "ledzepe" wrote: Hello gurus, Can somebody show me how to create a macro/script that would insert a row in a worksheet (Sheet1) and then copy the top row of another worksheet (Sheet2) into the inserted row? The copying needs to triggered manually. We have a 4 copy pre-printed form that we use a dot matrix to print to it and I made an Excel template where the clerk can enter the data and then just hit print. I am trying to capture the data that the clerk types in and create a database so we'll a searchable computer record. If inserting the data in a row is not possible, how about exporting a row and appending it on a text file? Thanks in advance. -- ledzepe ------------------------------------------------------------------------ ledzepe's Profile: http://www.excelforum.com/member.php...o&userid=25207 View this thread: http://www.excelforum.com/showthread...hreadid=386957 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
transaction log? | Excel Discussion (Misc queries) | |||
Transaction Classifications in Checkbook | Excel Worksheet Functions | |||
Copy and paste versus copy and insert copied cells | New Users to Excel | |||
Move/Copy or Copy/Insert worksheet? | Excel Discussion (Misc queries) | |||
Transaction type/ Transaction amount in two separate columns | New Users to Excel |