Below is the code I am currently using to update one worksheet to another. I would like to start updating WorkbookA to WorkbookB, I have a code to copy the informaiton but would like to update using the same command button, unsure of how to write that code, looking for help. Thanks!
Private Sub CommandButton1_Click()
Dim DateReceived As Date, PatientName As String, Plan As String, Region As Integer, Facility As String, Hospital As String
Worksheets("Main").Select
DateReceived = Range("B3")
PatientName = Range("C3")
Plan = Range("D3")
Region = Range("E3")
Facility = Range("F3")
Hospital = Range("G3")
Worksheets("Sub").Select
Worksheets("Sub").Range("B4").Select
If Worksheets("Sub").Range("B4").Offset(1, 0) <> "" Then
Worksheets("Sub").Range("B4").End(xlDown).Select
End If
ActiveCell.Offset(1, 0).Select
ActiveCell.Value = DateReceived
ActiveCell.Offset(0, 1).Select
ActiveCell.Value = PatientName
ActiveCell.Offset(0, 1).Select
ActiveCell.Value = Plan
ActiveCell.Offset(0, 1).Select
ActiveCell.Value = Region
ActiveCell.Offset(0, 1).Select
ActiveCell.Value = Facility
ActiveCell.Offset(0, 1).Select
ActiveCell.Value = Hospital
Worksheets("Main").Select
Worksheets("Main").Range("B3").Select
End Sub
Private Sub CommandButton1_Click()
Dim DateReceived As Date, PatientName As String, Plan As String, Region As Integer, Facility As String, Hospital As String
Worksheets("Main").Select
DateReceived = Range("B3")
PatientName = Range("C3")
Plan = Range("D3")
Region = Range("E3")
Facility = Range("F3")
Hospital = Range("G3")
Worksheets("Sub").Select
Worksheets("Sub").Range("B4").Select
If Worksheets("Sub").Range("B4").Offset(1, 0) <> "" Then
Worksheets("Sub").Range("B4").End(xlDown).Select
End If
ActiveCell.Offset(1, 0).Select
ActiveCell.Value = DateReceived
ActiveCell.Offset(0, 1).Select
ActiveCell.Value = PatientName
ActiveCell.Offset(0, 1).Select
ActiveCell.Value = Plan
ActiveCell.Offset(0, 1).Select
ActiveCell.Value = Region
ActiveCell.Offset(0, 1).Select
ActiveCell.Value = Facility
ActiveCell.Offset(0, 1).Select
ActiveCell.Value = Hospital
Worksheets("Main").Select
Worksheets("Main").Range("B3").Select
End Sub