Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 "Sohail khan" <Sohail wrote in message ... 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 |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 on save button.Kindly Give me code regarding these fields "Mike Fogleman" wrote: 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 "Sohail khan" <Sohail wrote in message ... 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 . |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Assuming both sheets have headers in row 1, this will transfer data from the
last used row, columns A:C of Sheet1 to the next empty row, columns A:C of sheet2. Private Sub CommandButton1_Click() Dim LRow As Long Dim Src As Range, Dest As Range LRow = Sheet2.Cells(Rows.Count, "A").End(xlUp).Row If IsEmpty(Sheet2.Cells(LRow, 1)) Then LRow = LRow Else LRow = LRow + 1 End If Set Dest = Sheet2.Range("A" & LRow & ":C" & LRow) LRow = Sheet1.Cells(Rows.Count, "A").End(xlUp).Row Set Src = Sheet1.Range("A" & LRow & ":C" & LRow) Dest.Value = Src.Value End Sub Mike F "sohail" wrote in message ... 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 on save button.Kindly Give me code regarding these fields "Mike Fogleman" wrote: 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 "Sohail khan" <Sohail wrote in message ... 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 . |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Insert data into SQL Server db - find out the record number | Excel Programming | |||
Issue w/ AutoNumber Field during DAO Record Insert | Excel Programming | |||
automatically insert 8 blank rows between each record | Excel Discussion (Misc queries) | |||
How do I get it to insert addresses instead of Next Record? | Excel Worksheet Functions | |||
Insert record into Excel database using a custom VBA form? | Excel Programming |