shadow74uk
New Member
- Joined
- Jun 4, 2007
- Messages
- 6
Please accept my apologises for this question! I'm self-taught at using VBA, inbetween my normal work, and so my programming practises aren't particularly good!
I'm trying to get a userform (frmPochange) to load and show and have a label (lblWrong) populated with a variable (pocheck) that is from a procedure running (manifest_PO_check) in Module1.
I've attached the code below. I'm sure it's a pretty obvious reason and something to do with my messy, non-declaring coding but I can't work it out! Please help.
Also as the form is loaded in the middle of a procedure does it stop executing the code until the form is closed?
----------------------------------------------------------------
Public Sub manifest_PO_check()
Dim pocheck As Variant
i = 5
Do Until Cells(i, 5) = ""
Let pocheck = Cells(i, 5)
If Len(pocheck) <> 10 Then
Load frmPochange '
End If
Let Cells(i, 5) = pocheck
i = i + 1
Loop
End Sub
-------------------------------------------------------------
Public Sub CommandButton1_Click()
pocheck = frmPochange.txtCorrect.text
frmPochange.Hide
End Sub
Public Sub UserForm_Initialize()
frmPochange.lblWrong.Caption=pocheck
frmPochange.Show
End Sub
------------------------------------------
Thanks in advance
Sharif
PS. Please no 'tutting' at my poor code!Work won't send me on a course yet!!
I'm trying to get a userform (frmPochange) to load and show and have a label (lblWrong) populated with a variable (pocheck) that is from a procedure running (manifest_PO_check) in Module1.
I've attached the code below. I'm sure it's a pretty obvious reason and something to do with my messy, non-declaring coding but I can't work it out! Please help.
Also as the form is loaded in the middle of a procedure does it stop executing the code until the form is closed?
----------------------------------------------------------------
Public Sub manifest_PO_check()
Dim pocheck As Variant
i = 5
Do Until Cells(i, 5) = ""
Let pocheck = Cells(i, 5)
If Len(pocheck) <> 10 Then
Load frmPochange '
End If
Let Cells(i, 5) = pocheck
i = i + 1
Loop
End Sub
-------------------------------------------------------------
Public Sub CommandButton1_Click()
pocheck = frmPochange.txtCorrect.text
frmPochange.Hide
End Sub
Public Sub UserForm_Initialize()
frmPochange.lblWrong.Caption=pocheck
frmPochange.Show
End Sub
------------------------------------------
Thanks in advance
Sharif
PS. Please no 'tutting' at my poor code!Work won't send me on a course yet!!