• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

copy cell in other sheet

kalpeshpatel

New Member
my probelm is copy cell in other sheet


sheet 1


C5 cell value is 1051


when i click command button this cell value is copy & paste in sheet 2 in Three Cell like A1 , A2 , A3


& now, agin i enter new value 2510 in C5 cell in sheet 1 is copy & paste in sheet 2 exact below earlyer paste cell like A4, A5, A6


how it is possibel
 
Hello Kalpesh Patel,


Firstly Welcome to Chandoo.org family.


This is done in VBA coding, copy the below code and paste in your excel VBA Editor


Sub AddRecord()


Dim lLstRw As Long

lLstRw = Sheet2.Range("A65000").End(xlUp).Row + 1

Sheet2.Range("A" & lLstRw).Value = Sheet1.Range("C5").Value

Sheet2.Range("A" & lLstRw + 1).Value = Sheet1.Range("C5").Value

Sheet2.Range("A" & lLstRw + 2).Value = Sheet1.Range("C5").Value


End Sub


Map your command button to macro named AddRecord.


Let me know if you need explanation of any of the line of code mentioned above.


Regards,

Prasad DN

PS: @Fred, Button control is also known as Command Button.
 
i need to solve my problem please


I use only A1: C4 cell to enter data ,

now my problem when i click command button how to copy cell range A2 : C4 when every time i enter data in above cell range look example like below


sheet 1


A1 B2 C3

Roll No Name Grade

51 vipul c

52 Jigar a

53 viral b


sheet 2 contain following heading


A1 B1 C1

Roll No Name Grade


now, sheet 1 range A2:C4 will copy & paste in sheet 2 below given heading like A2:C4 when i click command button on sheet 1 &


agin i enter new data in sheet 1 cell range A2 :C4 it will be copy & paste in sheet 2 in exact below in earlier paste cell (sheet 2) A5: C7


please give vba code or macro
 
Back
Top