Copy Cell in other sheet

K

kalpesh

Hello

i have problem to make inovice in excel jsut like a


sheet

A col B Col C COl D Co
Bill No Item Qut Rat

5012 mango 25 2
5012 banana 20 1
5012 apple 10 1


this content will copy togther in sheet 2 by i click ADD butto
then after other Same Column of three item on sheet 1 copy & paste i
sheet 2 exact below earlier paste item. how it work please give me vba code
 
G

Gord Dibben

Not sure but maybe...............?

NOTE: Sheet2 A1:D1 has same titles as Sheet1

Sub test()
Dim lastrow, lastCol As Long
Dim myRng, myRng2 As Range

With Worksheets("Sheet1")
lastrow = .Cells(.Rows.Count, "A").End(xlUp).Row
lastCol = .Cells(1, .Columns.Count).End(xlToLeft).Column
Set myRng = .Range("A3", .Cells(lastrow, lastCol))
End With

With Worksheets("Sheet2")
Set myRng2 = .Cells(.Rows.Count, "A").End(xlUp).Offset(1, 0)
End With

myRng.Copy Destination:=myRng2

End Sub


Gord
 

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