copy non-contu.data into new sheet

S

Shital

i have a created a Invoice in sheet1. Where i have used
vlookup function to lookup values from sheet2.

i want to create a Register for all the Invoice which i
print. I just want to copy some data from Invoice sheet
i.e. Cell a4,d7,e14,a10. (i.e. Date, Name,Ref. no., Amt)
When i print a invoice i should ask me do you want to
transfer data into sheet3, if yes than it should copy
above cell into sheet3 and print the invoice other wise i
should print invoice with out copy cell. It should copy
new data into next row when new invoice is print.

I try to copy data but it goto same row only. the copy is
like
Sub copydate()
Worksheets("Sheet1").Range("A1").Copy _
Destination:=Worksheets("Sheet2").Range("A2")
Worksheets("Sheet1").Range("D4").Copy _
Destination:=Worksheets("Sheet2").Range("B2")
Worksheets("Sheet1").Range("A10").Copy _
Destination:=Worksheets("Sheet2").Range("C2")
Worksheets("Sheet1").Range("E14").Copy _
Destination:=Worksheets("Sheet2").Range("D2")
End Sub

plz help me to work out this problem.

Shital Shah
 
S

steve

Shital,

try this: (correct for word wrap)

Sub copydate()

Dim lrow As Long

lrow = Sheets("Sheet2").Cells(Rows.COUNT, "A").End(xlUp).Offset(1, 0).Row

Worksheets("Sheet1").Range("A1").Copy _
Destination:=Worksheets("Sheet2").Range("A" & lrow)
Worksheets("Sheet1").Range("D4").Copy _
Destination:=Worksheets("Sheet2").Range("B" & low)
Worksheets("Sheet1").Range("A10").Copy _
Destination:=Worksheets("Sheet2").Range("C & low)
Worksheets("Sheet1").Range("E14").Copy _
Destination:=Worksheets("Sheet2").Range("D & low)
End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top