commandbutton?

G

Guest

I am entering info into Excel Sheet1 A1, B1, C1, D1. I want to click a
button (Submit) to move info to Sheet2 A1, B1, C1, D1. After I click button
I would like Sheet1 to be ready for new entries which when Submit is clicked
again will be moved to next rows on Sheet2 (A2, B2, C2,D2).

thanks
Bobby
 
G

Guest

I hit the post button too quick.

Sub CommandButton1_Click()
lr2 = Worksheets("Sheet2").Cells(Rows.Count, 1).End(xlUp).Row
Worksheets("Sheet1").Range("A1:D").Cut Worksheets("Sheet2").Range("A" & lr)
CutCopyMode = False
End Sub
 
G

Guest

hi,
another way, without using cut and paste.
Private Sub cb1_Click()
Dim fr As Range
Dim sr As Range
Set sr = Sheet2.Range("A65536").End(xlUp).Offset(1, 0)
Set fr = Range("A65536").End(xlUp)
sr.Value = fr.Value
sr.Offset(0, 1).Value = fr.Offset(0, 1).Value
sr.Offset(0, 2).Value = fr.Offset(0, 2).Value
sr.Offset(0, 3).Value = fr.Offset(0, 3).Value

End Sub
regards
FSt1
 

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