Insert Record

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
0
Utf
1/18/2010 3:14:01 PM
excel.programming 6508 articles. 2 followers. Follow

3 Replies
1019 Views

Similar Articles

[PageSpeed] 55

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 khan@discussions.microsoft.com> wrote in message 
news:6DEDBF5D-7CD4-4C02-9D83-5519128362E7@microsoft.com...
> 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 


0
Mike
1/18/2010 4:34:11 PM
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 khan@discussions.microsoft.com> wrote in message 
> news:6DEDBF5D-7CD4-4C02-9D83-5519128362E7@microsoft.com...
> > 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 
> 
> 
> .
> 
0
Utf
1/18/2010 6:15:01 PM
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" <sohail@discussions.microsoft.com> wrote in message 
news:0A8B13B6-C42D-4E26-9395-4603DA8A1CFE@microsoft.com...
> 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 khan@discussions.microsoft.com> wrote in message
>> news:6DEDBF5D-7CD4-4C02-9D83-5519128362E7@microsoft.com...
>> > 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
>>
>>
>> .
>> 


0
Mike
1/19/2010 11:28:30 AM
Reply:

Similar Artilces:

How do I insert Roman Numerals?
New to Word 2007 would someone please explain to me how to insert Roman Numerlas in my document? "ckj" <ckj@discussions.microsoft.com> wrote in message news:6CF0C580-BA6E-463D-B4FD-E6A6FDD9E814@microsoft.com... > New to Word 2007 would someone please explain to me how to insert Roman > Numerlas in my document? Just type them... I II III IV V VI VII VIII IX X XI etc etc. Type a number e.g. 21, select it and run the following macro Dim oRng As Range Set oRng = Selection.Range oRng.Fields.Add oRng, 34, oRng.Text & " \*Roman"...

Insert trigger
Looking for some advice on SQL 2005. I have a table that will usually be populated by an SSIS package. I want to set the "loaddate" column to the current time after a record is inserted. Should i do this via trigger or should i just build a step in the SSIS package to update the column after the file loads? If trigger is the way to go, what is the syntax to create the after insert trigger? Thanks in advance. You can create a default constraint on the table set to CURRENT_TIMESTAMP. That will handle the automatic date assignment without any need for coding. -...

How do I record a transaction to Accounts receivable?
I bought an item for "John" that cost $300. He will pay me back later. I paid for the item from my bank account and record it in Money as an expense. I'd also like to show the transaction as an accounts receivable from "John" or a loan to "John". How can I accomplish this? Craig, Create a new asset account called "Accounts Receivable" and record it in your bank account as a transfer to that account. This will result in the creation of a debt of $300. when the cash is paid back do a similar transfer. "Craig" wrote...

inserting hrs and minutes
I have a cell in my time card that displays total weekly time -ex- "40:15" is there a way to make it more like this...40hrs,15mins -- Message posted from http://www.ExcelForum.com Use a custom format hh"hrs",mm"mins" -- Regards, Peo Sjoblom "-Brian-H- >" <<Brian-H-.110wgs@excelforum-nospam.com> wrote in message news:Brian-H-.110wgs@excelforum-nospam.com... > I have a cell in my time card that displays total weekly time -ex- > "40:15" is there a way to make it more like this...40hrs,15mins ? > > > ...

record cash receipt by invoice line item
Great Plains should allow the option to enter one cash receipt per invoice line item. ---------------- This post is a suggestion for Microsoft, and Microsoft responds to the suggestions with the most votes. To vote for this suggestion, click the "I Agree" button in the message pane. If you do not see the button, follow this link to open the suggestion in the Microsoft Web-based Newsreader and then click "I Agree" in the message pane. http://www.microsoft.com/Businesssolutions/Community/NewsGroups/dgbrowser/en-us/default.mspx?mid=397cb5cd-706b-4edf-b717-1f0f64a1c01e&a...

How do I choose the 1st invoice record from each customer?
I need to run a query to pull the 1st invoice from each new customer for the year. Here is what I have done so far (probably not correct, but I tried). Thanks, Art SELECT DISTINCT [AJG revised 1st invoice date].[Customer Number], [AJG revised 1st invoice date].[Customer Name], Shipments.invoice_number, Shipments.invoice_date, Shipments.invoice_amount, Shipments.ar_number, Shipments.ar_name FROM Shipments INNER JOIN [AJG revised 1st invoice date] ON Shipments.ar_number = [AJG revised 1st invoice date].[Customer Number] Where Shipments.Invoice_number in (Select Top 1 Shipments.Invoice_n...

insert an interactive excel file into word web page
I'm trying to insert a excel file into a word document with text, and then save it was as a web page, but I want to keep the excel part interactive. Any ideas? ...

Insert | File > Attachmnet-Button Drop Down ;What is the difference between Insert and Insert As Attachmnet
re: "Outlook2003, File-Insert-Options" On making new-email with Attachment-File(s), ** File Menu | Insert | File >>> (Brows and select File to insert ) then we can see the button "Insert", and write side Drop Down Arrow lower-right side of Dialog Box; If it clicked, we can see three options as follows: ** Insert Insert as text Insert as Attachment I can not recognize/understand the difference between "Insert" and "Insert as Attachment" *** What is the difference between Insert and Insert As Attachment ? I would appreciate y...

Exchange Router Not Resolving to Customer Record
Hello, We are currently using the Exchange Router for 1.2 and sometime emails that enter the queues are not resolved automatically to a customer record even though the exact same email address is listed in a Contact's work and/or home email address fields. The Contact's email flag is also set to "allow." Wondering what I am missing here. -Brian The Exchange router will recognize email addresses in a record's primary E-mail address field only. If there are two records in CRM with the same email address, it will not associate the incoming email to either one. -- ...

Inserting Hyperlinks in a Protected Sheet
Hi I run Excel 2000 and I have a protected worksheet that I share wit users in my organisation. I want to allow the insertion of a hyperlin to a specific file type within a specified directory on our server. 3 Questions: 1.Protection on disables the insert hyperlink command. Can this b overcome with worksheet activate code? 2.Can I limit the types of files (preferably by requiring the file t meet a mask format eg "z-*.xls")? 3.Can I limit the directory that can be linked, by referring to pathname stored in a cell on the active sheet? Would appreciate your suggestions. Thanks S...

record cash receipt by line item
Great Plains should give an option to record cash receipt per line item on an invoice. ---------------- This post is a suggestion for Microsoft, and Microsoft responds to the suggestions with the most votes. To vote for this suggestion, click the "I Agree" button in the message pane. If you do not see the button, follow this link to open the suggestion in the Microsoft Web-based Newsreader and then click "I Agree" in the message pane. http://www.microsoft.com/Businesssolutions/Community/NewsGroups/dgbrowser/en-us/default.mspx?mid=29790378-1040-4f47-90f1-65567d808f0c&...

Grouping Records in a Form
I created a form and subform to write to my Material Takeoff Table. Fields are ISOID, MaterialID, POID, Quantity, etc. ISOID exists more than once in the Material Takeoff table. but no more than 1 material ID per ISOID. If I create a form based on the ISO table and sub form based on the table MaterialTakeoff, the Material ID's group by ISO. However, to add a new ISO to the Material Takeoff form, the main form is trying to write back to the ISO table. (I understand that the Main Form control source is ISO table not the Material Takeoff table for write purposes). How can I group the M...

Insert with a where condition
Hi, sql 2005 I have an insert statement that is ignoring the where condition. That is, I want to insert records when they do not already exist in the destination table. INSERT INTO dbo.tblmnuGroupPerm ( gId ,mtfID ,... ) SELECT @gID ,mtfID ,... FROM dbo.locmnuTabFunction AS ltf WHERE ltf.mtfID NOT IN ( SELECT gp.mtfID FROM dbo.tblmnuGroupPerm AS gp WHERE gp.gId=@gID AND gp.Deleted=0 ) Any ideas or recommendations appreciated :-) Many thanks, Jonathan It's OK... <oops "redFace">I did not correctly se...

How Do I Record Money Transfer Correctly?
Hi, I just got Money 2004 and run into a small problem: Money seems to be able to download transactions from bank accounts flawlessly, but it does not recognize transfers. Instead, transfers are recorded as withdraws and deposits, and show up in the cash flow report as expenses and incomes. I transferred 5K from a checking account to a broker account this month. Now it tells me that I spent 5K and made 5K. To correct this situation, I tried to change the transaction type to transfer. But when I changed the withdrawal transaction to transfer on one account, a new (transfer) transac...

Insert
I want to overtype in a Publisher text box. I find I can only insert. The "insert" key doesn't do anything. ...

Print Selected Record
I want to print a popup form. I used the command button wizzard to set up a button to print the form. How can I filter what's printed to be only the selected (active) record? -- Thanks. Sammie Access 2003 Although allowed, Forms are really not designed for printing. Why not just create a report to present the data for the current record. Then you can use the Where argument of the OpenReport method to have the report limited to the active record on the form? -- Dave Hargis, Microsoft Access MVP "Sammie" wrote: > I want to print a popup form. I used the command...

Access 2000 deleting records
Hello all, sorry for the previous post with nothing in it. Here is the problem I have resently upgraded an Access97 back end to Access 2000 due to size restrictions of Access97. we were running an Access 2000 frontend at that time. since converting to Access2k we keep getting "#Deleted" records "Can't save without edit or new" fields inside of records are "#deleted" and so on. I have run diags on equipment and found nothing out of the norm. Problem is intermittent, may go most of day without problem then get some or may start the day out with problem th...

Record Macro in Excel 2007 not recording everything
Hi, I've been using Excel 2007 for a few weeks now and I've noticed that the 'Record Macro' functionality is not so complete anymore. For example if you record a macro when adding a picture to your sheet,resizing & moving it, then saving your sheet. The result is the insert & save sheet code. The resizing & moving of the picture is not present in the macro. Another example, add a comment to a cell. Then start recording macro and change font of this comment. Then you got a nice empty macro. I hope this is a setting because otherwise I will go back to Excel 2003. ...

In Excel: If I know a file has 147,000 records, but Excel will on.
In Excel: If I know a file has 147,000 records, but Excel will only load 65,000, how do I get to the rest of the file? MVP Chip Pearson's website has some code that may help you out: http://www.cpearson.com/excel/imptext.htm HTH Jason Atlanta, GA >-----Original Message----- >In Excel: If I know a file has 147,000 records, but Excel will only load >65,000, how do I get to the rest of the file? >. > > attached a VBS script that I wrote to do that. Was unable to save it, Jim .. Could you paste it in the message itself ? Thanks -- Rgds Max xl 97 --- GMT+8, 1� 22...

how to insert data in a table
Hi Exprets; I am creating an access database in which I want to insert data in already created table. Kindly help. Regards, Vikky Vikky <love.excel@gmail.com> wrote in news:1194124711.012302.269990 @e34g2000pro.googlegroups.com: > Hi Exprets; > > I am creating an access database in which I want to insert data in > already created table. > > Kindly help. > > Regards, > > Vikky > Data from where? Do you want to import it from excel, from a text file, copy it from another table or type it in manually? -- Bob Quintal PA is y I've altere...

How do you insert page numbers larger than 1000?
I have my purchase orders set up as a Publisher document. When our organization upgraded from Publisher 2000 to Publisher 2002, the new version set parameters on the page numbers. This was one of those things that worked just fine in the previous version... Does anyone know how to turn it off or change it? Hi mregen (mregen@discussions.microsoft.com), in the newsgroups you posted: || I have my purchase orders set up as a Publisher document. When our || organization upgraded from Publisher 2000 to Publisher 2002, the new || version set parameters on the page numbers. This was one of those...

insert downloads into power point
i downloaded an application called "BioDigital Simulator" of an animated cleft lip/palate surgery and need it put into my power point presentation, but can't fiugre out how to do so.... very frustrating... What kind of file is this application? Is it a video? If so, what kind? MPEG? AVI? MOV? Or is it an EXE file? Something else? Which version of PPT are you using? -- Echo [MS PPT MVP] http://www.echosvoice.com What's new in PPT 2010? http://www.echosvoice.com/2010.htm Fixing PowerPoint Annoyances http://tinyurl.com/36grcd PowerPoint 2007 Complete Makeover...

Insert dataset to another database
I'm posting this to this group also since it pertains to queries, primarily. Hello, Using VB6/ADO, I'm thinking I can create a recordset and insert it into another table in a different Jet database, all within the execution of a single query. But, I can't seem to get it to work, even in an experiment in Access 2K. My sql in Access 2K: SELECT D.lorder as Ord, A.Lorder FROM [;Database = C:\MyDocuments\Acc2K\Wrk.mdb].OrdersData as A INNER JOIN [;Database = C:\Access\Work\Sales06.mdb].Detl1 as D On D.Lorder = a.lorder WHERE ((D.fg)= 'MXX-NC' Or (D.fg)= 'MXX.NC')...

How to combine Excel 2002 files and remove duplicate records?
I’ve recently took over a task at my job of managing some Excel files. I am using Excel 2002. There are several Excel files that need to be combined into one file however, if I do this, I will have some duplicate records that I will have to delete. The only way I know how to do this is to copy and paste and then look for duplicate records manually and delete them as I find them. Is there an easier way to do this? Thank you for you support and help. Yes, there is. I would use VBA to do that job, but I need more info. When you say there are duplicate records, exactly what is duplicated? ...

Insert a blank row
Hi, I need some help to insert a blank row in a range where column A has a series of dates. There will be several of the same dates and I need to both sort the dates and then insert the blank row at the end of each sequence. In the blank row I need to total figures that will be in columns B through to G. Thanks, Jim S Hi Jim maybe an easier solution 1. Sort your data (use 'Data - Sort', e.g., column A ascending) 2. Use 'Data - Subtotals' This will insert a row after each date and calculate subtotals automatically for you HTH Frank anon wrote: > Hi, > I need some...