+ Reply to Thread
Results 1 to 3 of 3

Code needed to move info. from one workbook to another.

Hybrid View

SLIDE1 Code needed to move info.... 09-05-2013, 01:45 PM
SLIDE1 Re: Code needed to move info.... 09-05-2013, 05:04 PM
SLIDE1 Re: Code needed to move info.... 09-06-2013, 07:29 AM
  1. #1
    Registered User
    Join Date
    09-25-2012
    Location
    Dallas, Texas
    MS-Off Ver
    Excel 2013
    Posts
    62

    Code needed to move info. from one workbook to another.

    Very limited VBA knowledge and stuck..
    I need help moving information from one workbook to another.
    What I have is a userform that gathers information and places it in a worksheet named "Information" in the same workbook .
    .
    What I need is for the data in this 1st workbook on worksheet "Information" to be copied to another workbook and then cleared.
    If it would be easier to copy directly to 2nd workbook and bypass the 1st worksheet alltogether that would be ok with me but I don't know how to do that either.
    .
    I will need to add additional data to the 2nd workbook as the userform is used... so the information should be copied to the first blank row below existing information in that 2nd workbook.
    The Workbooks and code below is what I have so far.
    .
    Workbook to copy data from name = ErrorsCaught.xlsm...worksheet name = Information
    Workbook to copy data to = ErrorDefinationWorkbook.xlsx....worksheet name = Information
    .
    Any and all help would be appreciated!
    Thanks in advance!
    SLIDE1

     Private Sub cmmbsubmit_Click()
    Dim RowCount As Long
    Dim ctl As Control
    If Me.combwhofound.Value = "" Then
            MsgBox "Please Select What Department Found Defect", vbExclamation, "Data Entry"
            Me.combwhofound.SetFocus
            Exit Sub
        End If
        If Me.combwhoresponsible.Value = "" Then
            MsgBox "Please Select What Department is Responsible for Defect", vbExclamation, "Data Entry"
            Me.combwhoresponsible.SetFocus
            Exit Sub
        End If
        If Me.txtpersonresponsible.Value = "" Then
            MsgBox "Please Enter Name of Person Responsible for Defect. If Name is Not Known Enter N/A", vbExclamation, "Data Entry"
            Me.txtpersonresponsible.SetFocus
            Exit Sub
        End If
        If Me.txtjobnumber.Value = "" Then
            MsgBox "Please Enter Job Number", vbExclamation, "Data Entry"
            Me.txtjobnumber.SetFocus
            Exit Sub
        End If
        If Me.txtopnumber.Value = "" Then
            MsgBox "Please Enter OP Number Where Defect Occurred", vbExclamation, "Data Entry"
            Me.txtopnumber.SetFocus
            Exit Sub
        End If
        If Me.txtdefect.Value = "" Then
            MsgBox "Please Enter Defect", vbExclamation, "Data Entry"
            Me.txtdefect.SetFocus
            Exit Sub
        End If
        RowCount = Worksheets("Information").Range("A1").CurrentRegion.Rows.Count
        With Worksheets("Information").Range("A1")
            .Offset(RowCount, 0).Value = Format(Now, "mm/dd/yy")
            .Offset(RowCount, 1).Value = Me.combwhofound.Value
            .Offset(RowCount, 2).Value = Me.combwhoresponsible.Value
            .Offset(RowCount, 3).Value = Me.txtpersonresponsible.Value
            .Offset(RowCount, 4).Value = Me.txtjobnumber.Value
            .Offset(RowCount, 5).Value = Me.txtopnumber.Value
            .Offset(RowCount, 6).Value = Me.txtdefect.Value
            .Offset(RowCount, 7).Value = Me.txtcomment.Value
        End With
        For Each ctl In Me.Controls
            If TypeName(ctl) = "TextBox" Or TypeName(ctl) = "ComboBox" Then
                ctl.Value = ""
            End If
        Next ctl
    End Sub
    
    Private Sub cmmclose_Click()
    Workbooks("Error's Caught.xlsm").Close savechanges:=True
    End Sub
    
    Private Sub UserForm_Click()
    
    End Sub
    Attached Files Attached Files
    Last edited by SLIDE1; 09-05-2013 at 05:01 PM.

  2. #2
    Registered User
    Join Date
    09-25-2012
    Location
    Dallas, Texas
    MS-Off Ver
    Excel 2013
    Posts
    62

    Re: Code needed to move info. from one workbook to another.

    Just bumping this one up after hopefully simplyfing explanation.

  3. #3
    Registered User
    Join Date
    09-25-2012
    Location
    Dallas, Texas
    MS-Off Ver
    Excel 2013
    Posts
    62

    Re: Code needed to move info. from one workbook to another.

    Another bump...

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] Code needed to move duplicates to another worksheet
    By collinlo in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 11-16-2012, 07:19 AM
  2. [SOLVED] Code needed to move rows to different worksheet based on date
    By collinlo in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 11-14-2012, 11:28 AM
  3. Help with macro to extract needed info from one worksheet and put it into another
    By KEVSTEF in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 06-06-2012, 02:43 PM
  4. Display needed info on different worksheet
    By netwarrior in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 09-29-2009, 11:52 PM
  5. Display needed info on different worksheet
    By netwarrior in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 09-10-2009, 12:13 AM

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