|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
VB excel message box
hmm...this time i need help with the message box. my code is as follows but i really dunno what is wrong with it....the message box pops out ok but the data displayed is not as what as i expected.
Private Sub CommandButton1_Click() moo = LCase(Sheet5.TextBox1.Text) b = 1 c = 1 If Sheet5.TextBox1.Text = "" Then MsgBox "Please Key In a Value" Exit Sub End If For a = 9 To 500 If LCase(Sheet3.Cells(a, 4)) = moo Then Sheet5.Cells(b + 7, 1) = Sheet3.Cells(a, 2) Sheet5.Cells(b + 7, 2) = Sheet3.Cells(a, 3) Sheet5.Cells(b + 7, 3) = Sheet3.Cells(a, 10) Sheet5.Cells(b + 7, 4) = Sheet3.Cells(a, 14) Sheet5.Cells(b + 7, 5) = Sheet3.Cells(a, 24) Sheet5.Cells(b + 7, 6) = Sheet3.Cells(a, 5) b = b + 1 ElseIf LCase(Sheet2.Cells(a, 4)) = moo Then Sheet5.Cells(c + 7, 1) = Sheet2.Cells(a, 2) Sheet5.Cells(c + 7, 2) = Sheet2.Cells(a, 5) Sheet5.Cells(c + 7, 3) = Sheet2.Cells(a, 9) Sheet5.Cells(c + 7, 4) = Sheet2.Cells(a, 18) Sheet5.Cells(c + 7, 5) = Sheet2.Cells(a, 25) Sheet5.Cells(c + 7, 6) = Sheet2.Cells(a, 6) c = c + 1 Exit Sub End If Next a MsgBox "Invalid" End Sub |
|
#2
|
|||
|
|||
|
Can you give some sample data, of what you are expecting to get, and what you actually get.
__________________
How can I soar like an eagle when I'm flying with turkey's? |
|
#3
|
|||
|
|||
|
access
its ok...coz eventually ive decided to use access instead...using excel is too risky as some functions that ive done like this is not able to handle many possible exceptions...
anyway r u familiar with access?? would be a great help for me as im now in the process of learning access... |
![]() |
| Viewing: Dev Shed Forums > Programming Languages - More > Visual Basic Programming > VB excel message box |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|