Insert Record

S

Sohail khan

Sir i want to insert record one sheet cells into another sheets cells through
command button. after saving data second data will save on next row
 
M

Mike Fogleman

Try this with Command Button on Sheet1:

Private Sub CommandButton1_Click()
Dim LRow As Long
Dim MyCell As String

LRow = Sheet2.Cells(Rows.Count, "A").End(xlUp).Row
If IsEmpty(Sheet2.Cells(LRow, 1)) Then
LRow = LRow
Else
LRow = LRow + 1
End If
MyCell = ActiveCell.Address
Sheet2.Cells(LRow, 1).Value = ActiveCell.Value
Sheet1.Range(MyCell).Activate

End Sub

Mike F
 
S

sohail

Mr Mike this code is not applied. I send you example

In Sheet1 there are 3 fields
A1: Invoice#
B1 DATE
C1: Qty
when I input in sheet 1 such as Invoice#: 1245, DATE: 18-1-2010, QTY:12.
Then i want these input fielsd will save in sheet2 serial wise when i click
 

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