+ Reply to Thread
Results 1 to 4 of 4

VBA coding of Userform help needed please

  1. #1
    Registered User
    Join Date
    04-02-2012
    Location
    Devon
    MS-Off Ver
    Excel 2011
    Posts
    7

    VBA coding of Userform help needed please

    Hi
    I am very new to Excel VBA. I am running Excel for Mac 2011. i have created the spreadsheet and I have created the user form that I want to use for data entry - its 8 fields/labels and 2 command buttons.

    I am totally stuck on how I start to create the actual code. Can anyone recommend a good crib sheet that I can use?

    many thanks

    A
    Last edited by Alexph; 04-02-2012 at 04:44 PM.

  2. #2
    Forum Expert Cutter's Avatar
    Join Date
    05-24-2004
    Location
    Ontario,Canada
    MS-Off Ver
    Excel 2010
    Posts
    6,451

    Re: VBA coding of Userform help needed please

    Perhaps this site will help you:
    http://www.contextures.com/xlUserForm01.html

    or this one:
    http://www.exceltip.com/st/Create_Us...Excel/629.html

  3. #3
    Registered User
    Join Date
    04-02-2012
    Location
    Devon
    MS-Off Ver
    Excel 2011
    Posts
    7

    Re: VBA coding of Userform help needed please

    Thank you for the help

    I have coded my form as follows:
    Private Sub frmPostage_Initialize()
    TxtDate.Value = ""

    With cboBusiness
    .AddItem "Hulu Limited"
    .AddItem "Moustraining"
    .AddItem "The Modbury Group"
    End With
    cboBusiness.Value = ""

    With cboService
    .AddItem "Packet Post"
    .AddItem "Letter"
    .AddItem "Tracked"
    End With
    cboService.Value = ""

    With cboClass
    .AddItem "First"
    .AddItem "Second"
    .AddItem "EU"
    .AddItem "ROW"
    .AddItem "Special Delivery"
    End With
    cboClass.Value = ""

    With cboService
    .AddItem "Packet Post"
    .AddItem "Letter"
    .AddItem "Tracked"
    End With
    cboService.Value = ""

    txtQty.Value = ""

    txtAvWt.Value = ""

    txtCostValue = ""

    txtRecQtyValue = ""

    txtSDQtyValue = ""

    TxtDate.SetFocus

    End Sub

    I expected that the four combo boxes would have the options above displayed, but when i run the form, the combo boxes are blank. I cannot see what mistake I must have made. I am using Excel for Mac is that makes any difference?

    Thanks

  4. #4
    Registered User
    Join Date
    04-02-2012
    Location
    Devon
    MS-Off Ver
    Excel 2011
    Posts
    7

    Re: VBA coding of Userform help needed please

    Its Ok, I have realised what i have done wrong now working Ok
    Thanks

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1