+ Reply to Thread
Results 1 to 4 of 4

Transfering data from one sheet to a master sheet using Submit (command button)

  1. #1
    Registered User
    Join Date
    06-01-2013
    Location
    New Delhi, India
    MS-Off Ver
    Excel 2007
    Posts
    5

    Transfering data from one sheet to a master sheet using Submit (command button)

    Hi all,

    I am getting Run time error: '1004' while running the code below which is to copy and update the data from the form on sheet 1 automatically to a sheet2. This is the attached aduit sheet that I am creating. I need to colate data from all the auditors who will audit on the same shared sheet and the data will come to sheet 2 automatically. Moreover, I was not able to insert command button activeX and got Cannot Insert Object error so I used the Form Button to assign below macro to it.

    Sub Button1_Click()

    Dim RecordNo As String, DateOfTransaction As Date

    Worksheets("sheet1").Select
    RecordNo = Range("D1")
    DateOfTransaction = Range("D2")

    Worksheets("sheet2").Select
    Worksheets("sheet2").Range("A1").Select

    If Worksheets("sheet2").Range("A1").Offset(1, 0) <> " " Then
    Worksheets("sheet2").Range("A1").End(x1Down).Select
    End If

    ActiveCell.Offset(1, 0).Select
    ActiveCell.Value = RecordNo
    ActiveCell.Offset(0, 1).Select
    ActiveCell.Value = DateOfTransaction
    Worksheets("sheet1").Select
    Worksheets("sheet1").Range("D1").Select

    End Sub


    getting error on the line that is in bold.. Please help..
    Attached Files Attached Files
    Last edited by readitdaily; 06-01-2013 at 09:36 AM. Reason: added more information

  2. #2
    Forum Expert
    Join Date
    07-15-2012
    Location
    Leghorn, Italy
    MS-Off Ver
    Excel 2010
    Posts
    3,431

    Re: Transfering data from one sheet to a master sheet using Submit (command button)

    Please Login or Register  to view this content.
    If solved remember to mark Thread as solved

  3. #3
    Registered User
    Join Date
    06-01-2013
    Location
    New Delhi, India
    MS-Off Ver
    Excel 2007
    Posts
    5

    Re: Transfering data from one sheet to a master sheet using Submit (command button)

    Thanks Patel45 for your reply. Would you please explain me how that worked and what was wrong with my code? That is just to learn. I appreciate al the time that you may take.

    regards,
    Rahul

  4. #4
    Registered User
    Join Date
    06-01-2013
    Location
    New Delhi, India
    MS-Off Ver
    Excel 2007
    Posts
    5

    Re: Transfering data from one sheet to a master sheet using Submit (command button)

    Thanks for reply. It is solved.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1