|
|
|||||||||
|
|||||||||
|
|||||||||
| |
||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Need Assistance with Code
Hi,
I created a form in Excel, and in the form is a list box with some drop down boxes. There is a current "enter" button on the form, which populates a spreadsheet with the entered information once it is clicked. My problem is with the List Box. The list box's Row Source is set up to pull from data (street addresses) that is already in the spreadsheet. I just put the list down box there, so that users can identify which address they are populating the information to. Is it possible to be able to click on the address in the list box and click "enter" so that it will automatically find the matching address in the spreadsheet? I attached my code for a reference. If you have any suggestions or ideas, it would help out a lot. Thanks! Private Sub cmdCancel_Click() Unload Me End Sub Private Sub cmdOK_Click() ActiveWorkbook.Sheets("Dilapidation Form").Activate Range("I2").Select Do If IsEmpty(ActiveCell) = False Then ActiveCell.Offset(1, 0).Select End If Loop Until IsEmpty(ActiveCell) = True ActiveCell.Offset(0, 1) = lbAddressList.Value ActiveCell.Offset(0, 2) = cboAsbestos.Value ActiveCell.Offset(0, 3) = cboEstimable.Value ActiveCell.Offset(0, 4) = txtAmount.Value ActiveCell.Offset(0, 5) = cboMercury.Value ActiveCell.Offset(0, 6) = cboEstimable2.Value ActiveCell.Offset(0, 7) = txtAmount2.Value ActiveCell.Offset(0, 8) = cboLeadBasedPaint.Value ActiveCell.Offset(0, 9) = cboEstimable3.Value ActiveCell.Offset(0, 10) = txtAmount3.Value ActiveCell.Offset(0, 11) = cboFixedAssetCleanUp.Value ActiveCell.Offset(0, 12) = cboEstimable4.Value ActiveCell.Offset(0, 13) = txtAmount4.Value ActiveCell.Offset(0, 14) = cboGroundWater.Value ActiveCell.Offset(0, 15) = cboEstimable5.Value ActiveCell.Offset(0, 16) = txtAmount5.Value ActiveCell.Offset(0, 17) = cboABGroundStorage.Value ActiveCell.Offset(0, 18) = cboEstimable6.Value ActiveCell.Offset(0, 19) = txtAmount6.Value ActiveCell.Offset(0, 20) = cboOther.Value ActiveCell.Offset(0, 21) = cboEstimable7.Value ActiveCell.Offset(0, 22) = txtAmount7.Value Range("I2").Select End Sub Private Sub cmdClearForm_Click() Call UserForm_Initialize End Sub Private Sub UserForm_Initialize() txtAmount.Value = "" lbAddressList.Value = "" With cboAsbestos .AddItem "Yes" .AddItem "No" End With cboAsbestos.Value = "" With cboEstimable .AddItem "Yes" .AddItem "No" End With txtAmount2.Value = "" With cboMercury .AddItem "Yes" .AddItem "No" End With cboMercury.Value = "" With cboEstimable2 .AddItem "Yes" .AddItem "No" End With txtAmount3.Value = "" With cboLeadBasedPaint .AddItem "Yes" .AddItem "No" End With cboLeadBasedPaint.Value = "" With cboEstimable3 .AddItem "Yes" .AddItem "No" End With txtAmount4.Value = "" With cboFixedAssetCleanUp .AddItem "Yes" .AddItem "No" End With cboFixedAssetCleanUp.Value = "" With cboEstimable4 .AddItem "Yes" .AddItem "No" End With txtAmount5.Value = "" With cboGroundWater .AddItem "Yes" .AddItem "No" End With cboGroundWater.Value = "" With cboEstimable5 .AddItem "Yes" .AddItem "No" End With txtAmount6.Value = "" With cboABGroundStorage .AddItem "Yes" .AddItem "No" End With cboABGroundStorage.Value = "" With cboEstimable6 .AddItem "Yes" .AddItem "No" End With txtAmount7.Value = "" With cboOther .AddItem "Yes" .AddItem "No" End With cboOther.Value = "" With cboEstimable7 .AddItem "Yes" .AddItem "No" End With lbAddressList.SetFocus End Sub |
![]() |
| Viewing: ASP Free Forums > Other > Programming Help > Need Assistance with Code |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|