Help me!!

tomistuck

New Member
Joined
Feb 24, 2005
Messages
18
Hey I am doing excel work for school and im stuck. Well stuck is not even a word to describe how stuck I am.

as you can see on the spreadsheet(attached, the password is ign) when you click "add customer" it brings up a userform with some fields to fill in, what I need to do is somehow make it so when you fill in these fields and click done they fill into the right fields on the sheet "customerlist".(eg name goes in to name)

Is there any possible way to do this, or am I all out of luck?

here is a link to the spreadsheet.

http://www.warcraftunlimited.com/invoicemarinertravel.xls

thank you.
( i think its clear from the two exclamation marks how stuck I am)
 

Some videos you may like

Excel Facts

Format cells as time
Select range and press Ctrl+Shift+2 to format cells as time. (Shift 2 is the @ sign).

jindon

MrExcel MVP
Joined
Aug 21, 2004
Messages
16,995
Hi

paste the code onto form module
Change the control name for the Name to nm
better not use pre-asigned name.

Code:
Private Enum AddrsDetails
    nm = 1
    AddressLIne1 = 2
    AddressLIne2 = 3
    country = 5
    Town = 4
    postcode = 6
End Enum

Private Sub CommandButton1_Click()
Dim col As AddrsDetails, wsC As Worksheet, LastR As Long
Set wsC = Sheets("customerlist")
With wsC
    LastR = .Range("a65536").End(xlUp).Row + 1
    col = nm: .Cells(LastR, col) = Me.nm: Me.nm = ""
    col = AddressLIne1: .Cells(LastR, col) = Me.TextBox2: Me.TextBox2 = ""
    col = AddressLIne2: .Cells(LastR, col) = Me.TextBox3: Me.TextBox3 = ""
    col = country: .Cells(LastR, col) = Me.TextBox5: Me.TextBox5 = ""
    col = postcode: .Cells(LastR, col) = Me.TextBox6: Me.TextBox6 = ""
    col = Town: .Cells(LastR, col) = Me.TextBox4: Me.TextBox4 = ""
End With
End Sub

do the rest for yourself

rgds,
jindon
 

tomistuck

New Member
Joined
Feb 24, 2005
Messages
18
what is the form module.

also thank you for helping me with that, you now the best person going.
 

jindon

MrExcel MVP
Joined
Aug 21, 2004
Messages
16,995
tomistuck,

Did you really make the form for yourself?

if you don't have any idea of Module then how counld you write a code?

Study hard!!!

open VB editor and right click on the Userform1 icon in the project window
and select View Code then paste the code there

rest you must search for your self.
don't even try to think to ask What is Enum, what is Me.etc

That's your study.

rgds,
jindon
 

tomistuck

New Member
Joined
Feb 24, 2005
Messages
18
well i did try doing that but I figured it was wrong since I got a compile error.
 

jindon

MrExcel MVP
Joined
Aug 21, 2004
Messages
16,995
Have you changed the control name for textbox Name to nm?

You shouldn't asign those names like Name, Address....

Read the first post from me carefully.

rgds,
jindon
 

Watch MrExcel Video

Forum statistics

Threads
1,122,694
Messages
5,597,571
Members
414,156
Latest member
WDMix

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
Top