+ Reply to Thread
Results 1 to 5 of 5

Combine UserForm_Initialize errors

  1. #1
    Forum Contributor onmyway's Avatar
    Join Date
    09-03-2012
    Location
    Johannesburg, South Africa
    MS-Off Ver
    2013
    Posts
    386

    Combine UserForm_Initialize errors

    Hi All,

    I need some help correcting my code. How do I go about combining these 2 parts of script?

    Please Login or Register  to view this content.
    and

    Please Login or Register  to view this content.
    There is obviously an ambiguity issue with the "Private Sub UserForm_Initialize()", and when I combine it in various ways, I get other errors....

    Thanks for the help!

  2. #2
    Forum Expert
    Join Date
    04-22-2013
    Location
    .
    MS-Off Ver
    .
    Posts
    4,418

    Re: Combine UserForm_Initialize errors

    Please Login or Register  to view this content.
    You can't have two modules with the same name.

  3. #3
    Forum Contributor onmyway's Avatar
    Join Date
    09-03-2012
    Location
    Johannesburg, South Africa
    MS-Off Ver
    2013
    Posts
    386

    Re: Combine UserForm_Initialize errors

    Thanks for the help! But I am getting the following error: Run-time error '9': Subscript out of range.

    I would appreciate if someone could take a look. I have attached my workbook. The sheet named "DataSheet - Fitness" has the macro button "Capture new record" to open the UserForm. The error only started with the last section of code, I have inserted below:

    Please Login or Register  to view this content.
    This is for combining the 2 section of code in my first post. The one part of code is to add the sheets to a ListBox, the other is for creating a GUID.

    Thanks!
    Attached Files Attached Files
    Last edited by onmyway; 07-31-2013 at 07:05 AM.

  4. #4
    Forum Guru JosephP's Avatar
    Join Date
    03-27-2012
    Location
    Ut
    MS-Off Ver
    2003/10
    Posts
    7,328

    Re: Combine UserForm_Initialize errors

    your data in column A doesn't contain '-' so I can't see why you are using Split(..., "-") on it?
    Josie

    if at first you don't succeed try doing it the way your wife told you to

  5. #5
    Forum Contributor onmyway's Avatar
    Join Date
    09-03-2012
    Location
    Johannesburg, South Africa
    MS-Off Ver
    2013
    Posts
    386

    Re: Combine UserForm_Initialize errors

    LOL. Thanks JosephP -

+ 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. Combine 2 formulas to ignore errors?
    By ross.mitchell in forum Excel General
    Replies: 4
    Last Post: 12-09-2009, 09:25 AM
  2. [SOLVED] Set Me.Picture on UserForm_Initialize
    By mpeplow in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 06-13-2007, 05:49 PM
  3. UserForm_Initialize
    By RB Smissaert in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 04-13-2006, 11:52 AM
  4. Replies: 1
    Last Post: 08-25-2005, 03:43 AM
  5. [SOLVED] UserForm_Initialize error
    By Jennifer in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 04-24-2005, 05:07 PM

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