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
Bookmarks