How Read Row Vba Excel And Display In Textbox

[Solved] How Read Row Vba Excel And Display In Textbox | Vb - Code Explorer | yomemimo.com
Question : how read row vba excel and display in textbox

Answered by : disturbed-duck-ttnhrgx2dt6g

Set sh = ThisWorkbook.Sheets("Testing")
sh.Range("F21").Activate
With sh fatalcount = WorksheetFunction.CountIf(Range("F:F"), "Fatal") Majorcount = WorksheetFunction.CountIf(Range("F:F"), "Major") Minorcount = WorksheetFunction.CountIf(Range("F:F"), "Minor")
End With
For jrow = 1 To 11
For i = 0 To 4 Set txtB1 = WtmsFrm.Controls.Add("Forms.TextBox.1") With txtB1 .Name = "chkDemo" & i .Height = 20 .Width = 5 + 50 + 5 .Left = 10 + 50 * i + 2 .Top = 15 * jrow + 10 .ControlTipText = "Type of Bug" End With Next i
Next jrow
For Each tbox In Frm.Controls ' For counter = 2 To 11 If tbox.Name = "chkDemo" Then tbox.Value = Sheets("sheet1").Cells(counter, 2).Value ' failing code tbox.ControlTipText = "Name" ElseIf tbox.Name = "chkDemo1" Then tbox.Value = 1 ElseIf tbox.Name = "chkDemo2" Then tbox.Value = 2 ElseIf tbox.Name = "chkDemo3" Then tbox.Value = 3 ElseIf tbox.Name = "chkDemo4" Then tbox.Value = 4 End If ' Next counter
Next
' Initialise the followings Frm.txtFatal.Value = fatalcount Frm.txtMajor.Value = Majorcount Frm.txtMinor.Value = Minorcount Frm.txtTotoal.Value = fatalcount + Majorcount + Minorcount
End Sub

Source : https://stackoverflow.com/questions/36597220/read-a-column-from-a-excel-sheet-display-on-textbox-vba | Last Update : Tue, 25 May 21

Answers related to how read row vba excel and display in textbox

Code Explorer Popular Question For Vb