VBA Excel 2010 Passing Data Between Userform and Worksheet

killiouta

New Member
Joined
Mar 18, 2014
Messages
3
Hi, I’m an intermediate programmer but new to VB/VBA and rather unfamiliar with the VBA Object Model. I was tasked to build a "pusedo" vending machine program for a self-service concession stand. I am trying to sharpen my VBA skills instead of writing it in a language i already know. Here a summary of what I am attempting to accomplish.


1. User enters ID number and clicks Enter button
search column “A” on “Sheet2” for a matching id number
if match found, populate name to name text box, balance to balance text box, and purchase history to list-box


2. User can click on various price buttons
each button click value will be added to the total text box




3. User can add to balance or pay for purchase.
if add to balance is clicked, add the total to the balance
if pay is clicked, amount entered for payment will be subtracted from balance


4. all user form actions should be updated on sheet2


5. if cancel selected, clear form data and do not update spreadsheet


6. if done is selected, save document

i am lost on much of this project and any assistance would be appreciated. My project can be found here: https://www.dropbox.com/s/zhubys0z0w7z4t3/concession.xlsm

here is my current code that looks for the the id number match

Private Sub identer_btn_Click()
On Error GoTo errorhandler
Application.ScreenUpdating = False
Range("A1:A50").Select
Selection.Find(What:=Consession.id_txt.Text, After:=ActiveCell, LookIn:=xlValues, LookAt _
:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, MatchCase:=False).Activate
Unload Consession
ActiveCell.Offset(1, 0)
Cells(1, 1).Select
Exit Sub
errorhandler:
MsgBox "ID Not on Team Roster! You must pay for your items now!" & vbOKOnly
Consession.id_txt.SetFocus
End Sub
 

Excel Facts

Round to nearest half hour?
Use =MROUND(A2,"0:30") to round to nearest half hour. Use =CEILING(A2,"0:30") to round to next half hour.

Forum statistics

Threads
1,214,919
Messages
6,122,260
Members
449,075
Latest member
staticfluids

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top