which text be selects in VBA listboxs

X

xcweibing

If ListBox2.Index = "2" Then
Sheet3.Cells(3, 2) = TextBox1.Text
Sheet3.Cells(4, 2) = "φ" & TextBox2.Text
Sheet3.Cells(5, 2) = "NHC-7"
Sheet3.Cells(6, 2) = Format(Date, "dddddd")
Sheet3.Cells(13, 4) = (2 * TextBox5.Text + 4.2) & "±0.04"
Sheet3.Cells(14, 4) = (2 * TextBox5.Text + 3.9) & "±0.03"
Sheet3.Cells(15, 4) = (TextBox5.Text + 0.85) & "±0.15"
Sheet3.Cells(16, 4) = (TextBox5.Text + 0.48) & "±0.04"
Sheet3.Cells(17, 4) = (TextBox5.Text + 0.28) & "±0.03"
Sheet3.Cells(19, 4) = (TextBox5.Text + 0.16) & "±0.02"
Sheet3.Cells(20, 4) = (TextBox5.Text + 0.1) & "±0.02"
Sheet3.Cells(21, 4) = (TextBox5.Text + 0.05) & "±0.01"
Sheet3.Cells(22, 4) = (TextBox5.Text + 0.02) & "±0.005"
Sheet3.Cells(23, 4) = (TextBox5.Text + 0.01) & "±0.005"
Sheet3.Cells(24, 4) = TextBox5.Text & "±0.005"
Sheet3.Cells(24, 6) = "Ra0.4"
 
D

Dave Peterson

I _think_

If ListBox2.listIndex = 2 Then

0 is the top option
1 is the 2nd
2 is the third
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top