I'm trying to develop a Userform with text and a checkbox. I'm having problem with the coding.
Here is the coding i have so far.
Public r As String Private Sub CheckBox1_Click() If cbRev.Enabled = True Then r = 1 End If End Sub End Sub Private Sub cmdAddEntry_Click() Dim ws As Worksheet Set ws = Worksheets("Master") With ws If r <> 1 Then ActiveCell.Offset(0, 1).Value = txtJob.Value & " " & txtScope.Value & ".pdf" Else ActiveCell.Offset(0, 1).Value = txtJob.Value & " " & txtScope.Value & " " & "(Rev).pdf" End If End With 'clear the data Me.txtScope.Value = "" Me.txtJob.Value = "" End Sub
Part of the code was taken from an example from online search. My problem is with the checkbox. How do I set it to code that when it is checked then it uses the second value line and unchecked it uses the first line value and then sends it to the cell next to the one being used to call the userform.
Quick setup. Column D holds pull down menu. One option is called "Scope Report". If say cell D2 is used and Scope Report is pull up then the userform comes and the user fills in the information into txtjob and txtscope and either checks rev or not. The user then clicks add entry and cell E2 gets either the first value or second value.
That is where I'm having problems, locating the checkbox info so the program and send the right info.