Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.
Private Sub cmdProcess_Click() Dim wkb As String, i As Integer, response As Integer, msg As String, title As String, style As String, _ intcounter As Integer, oCtrl As Control, k As String 'check for list box selection If Me.lstTrans = vbNullString Then 'if nothing was selected, tell user and let them try again ->> Exit Sub Else 'only controls For Each oCtrl In frm_ledger_coding.fra1.Controls 'only option buttons If TypeName(oCtrl) = "OptionButton" Then 'which one is checked? If oCtrl.Value = True Then 'what's the tag? k = oCtrl.Tag Exit For End If End If Next 'specifying cunter to start from row 2 intcounter = 2 If k = "" Then Exit Sub Else 'specifying list selection counts For i = 0 To lstTrans.ListCount - 1 If lstTrans.Selected(i) Then With ActiveWorkbook.Worksheets("Import") 'Range H being the amount which always have a value While .Range("H" & intcounter).Value <> "" 'compare the key in column c with the list value in column 0 (bound column) If .Range("C" & intcounter).Value = lstTrans.List(i) Then Range("I" & intcounter).Value = k End If intcounter = intcounter + 1 Wend End With End If Next i End If End Sub
Add your voice to the tech community where 5M+ people just like you are talking about what matters.
Join the community of 500,000 technology professionals and ask your questions.