Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 226
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
transaction log? Wm Watt Excel Discussion (Misc queries) 1 June 30th 08 06:21 PM
Transaction Classifications in Checkbook mscureman Excel Worksheet Functions 6 January 31st 08 07:31 PM
Copy and paste versus copy and insert copied cells Alana New Users to Excel 1 September 28th 07 08:58 PM
Move/Copy or Copy/Insert worksheet? kjk Excel Discussion (Misc queries) 0 December 15th 06 02:40 PM
Transaction type/ Transaction amount in two separate columns Mike New Users to Excel 5 November 9th 06 02:38 PM


All times are GMT +1. The time now is 12:02 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"