I have a workbook containing 3 sheets. The first two sheets use a input form to write data to each sheet, and across th two sheets in certain circumstances. I have now added a third sheet where data is inputted from the second input form. This works, however I now wish to filter that write, dependant on user selection. On the 2nd user input form there are 3 scenarios a user can select. These filter fields on the form and therefore the data set which is required to be entered and sent to the sheets. Again this works, however I now wish to stop data being sent to one of the sheets if scenario 1 or 3 is selected. Therefore data should only be sent to sheet 3 if scenario 2 is selected. If scenario 1 or 3 is selected (only one can be selected at a time) then data should not be written to sheet 3.
My basic code for naming the spreadsheet columns is. this sends the data from the input sheet fields to the correct columns on the sheets
The code is much longer than this, I have just copied the first few lines
I then have my selection code which filters off (hides) those field I do not wish collect data in on the input forms.
So what i am looking for is,
If Sub FIFDA_Click() = True Then
write to Sheets 1 and 2 but not 3
If Sub FIINDET_Click() = True Then
write to sheets 1, 2, 3
If Sub FIODA_Click() = True Then
write to sheets 1 and 2 but not 3
Any help always appreciated - best wishes
My basic code for naming the spreadsheet columns is. this sends the data from the input sheet fields to the correct columns on the sheets
VBA Code:
RowCount = Worksheets("Sheet1_Log").Range("A1").CurrentRegion.Rows.Count
With Worksheets("Sheet1_Log").Range("A1")
.Offset(RowCount, 0).Value = Me.Ref.Value
.Offset(RowCount, 1).Value = Me.Inp1.Value
.Offset(RowCount, 2).Value = Me.Inc3.Value
.Offset(RowCount, 3).Value = Me.Tm3.Value
.Offset(RowCount, 4).Value = Me.ComboBox1.Value
.Offset(RowCount, 5).Value = Me.FIDiary.Value
.Offset(RowCount, 12).Value = Me.TextBox2.Value
.Offset(RowCount, 27).Value = Me.FIComments.Value
End With
RowCount = Worksheets("Sheet2-Log").Range("A1").CurrentRegion.Rows.Count
With Worksheets("Sheet2-Log").Range("A1")
.Offset(RowCount, 0).Value = Me.Ref.Value
.Offset(RowCount, 1).Value = Me.Inp1.Value
.Offset(RowCount, 2).Value = Me.Inc3.Value
.Offset(RowCount, 3).Value = Me.Tm3.Value
.Offset(RowCount, 4).Value = Me.ComboBox1.Value
End With
RowCount = Worksheets("Sheet3").Range("A1").CurrentRegion.Rows.Count
With Worksheets("Sheet3").Range("A1")
.Offset(RowCount, 0).Value = Me.Ref.Value
.Offset(RowCount, 1).Value = Me.Inp1.Value
.Offset(RowCount, 2).Value = Me.Inc3.Value
.Offset(RowCount, 3).Value = Me.Tm3.Value
End With
The code is much longer than this, I have just copied the first few lines
I then have my selection code which filters off (hides) those field I do not wish collect data in on the input forms.
VBA Code:
Private Sub FIFDA_Click()
If FIFDA.Enabled = True Then
If FIDiary.Enabled = True Then FIDiary.Text = "Test - - - - -"
Me.FIPort.Visible = False
Me.Label18.Visible = False
Me.FILoc.Visible = False
Me.Label20.Visible = False
End Sub
Private Sub FIINDET_Click()
If FIFDA.Enabled = True Then
'If FIDiary.Enabled = True Then FIDiary.Text = "Test ********"
Me.FIWhom.Visible = False
Me.Label17.Visible = False
End Sub
Private Sub FIODA_Click()
If FIFDA.Enabled = True Then
If FIDiary.Enabled = True Then FIDiary.Text = "UK ^^^^^^^^^^"
Me.FIInLand.Visible = False
Me.FIINDET.Visible = False
Me.FIPort.Visible = False
End Sub
So what i am looking for is,
If Sub FIFDA_Click() = True Then
write to Sheets 1 and 2 but not 3
If Sub FIINDET_Click() = True Then
write to sheets 1, 2, 3
If Sub FIODA_Click() = True Then
write to sheets 1 and 2 but not 3
Any help always appreciated - best wishes