+ Reply to Thread
Results 1 to 15 of 15

Looping Through Userform Controls

Hybrid View

  1. #1
    Forum Contributor
    Join Date
    04-07-2015
    Location
    Halifax, NS
    MS-Off Ver
    365
    Posts
    100

    Re: Looping Through Userform Controls

    I tried this code but it gave an error at
    frmRecipeBox.Controls("Cost" & I).Value = Application.VLookup(myIng, MyRange, Res, 0) * myAmt
    Couldn't find the object. There is no control named "Cost". There is a cost textbox for each ingredient (Cost1, Cost 2........Cost15). These controls do not get saved to the table. They are just used to calculate the total cost of the recipe by looking up the cost of each ingredient, adding them together and putting the result in the control named rec65. There is a naming pattern for the controls that are being added to the table row. They are named rec1 to rec 68.
    I am attaching a copy of my form and the complete macro so you can get a better idea. What if I changed the naming patterns to something like Ing1....Ing15; Amt1....Amt15, etc.
    Thanks
    Attached Files Attached Files

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] Looping through controls by frame on userform (frame within a frame)
    By njs27 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 03-27-2015, 10:21 AM
  2. Looping through label controls
    By anthony1312002 in forum Excel General
    Replies: 2
    Last Post: 02-03-2012, 03:20 PM
  3. looping controls in to an array
    By stoney1977 in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 10-20-2008, 12:57 PM
  4. looping through controls
    By cmpcwil2 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 04-18-2006, 05:48 AM
  5. Looping through controls
    By Libby in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 04-27-2005, 12:06 PM
  6. [SOLVED] Looping through controls on form
    By Robbyn in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-15-2005, 11:06 AM
  7. Problem with looping through userform controls
    By Jeremy Gollehon in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 02-18-2005, 10:06 AM

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