+ Reply to Thread
Results 1 to 5 of 5

combobox range - type mismatch !

  1. #1
    Forum Contributor
    Join Date
    02-09-2014
    Location
    Kamnik, Slovenia
    MS-Off Ver
    Excel 2010
    Posts
    693

    combobox range - type mismatch !

    hello,

    I have this code for Userform's Combobox to show days in months:

    Please Login or Register  to view this content.
    Problem is, that I copy first sheet within that range of days, then (with macro) create all months in year with Dateserial within range, and delete all extra columns for days that are redundant according to month.

    So, when I try to open userform on sheets where days in month are not 31 as on first sheet, I get an error "Type mismatch" !

    How can I change range in Combobox so that It will adjust on every number of days ?

  2. #2
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643

    Re: combobox range - type mismatch !

    Adjust the range you are looping based on the month of the active sheet.

    Or instead of a For loop try this.
    Please Login or Register  to view this content.
    By the way, how are the values formatted on the sheet?
    If posting code please use code tags, see here.

  3. #3
    Forum Contributor
    Join Date
    02-09-2014
    Location
    Kamnik, Slovenia
    MS-Off Ver
    Excel 2010
    Posts
    693

    Re: combobox range - type mismatch !

    Hi Norie,

    Your code is great, just had to change empty cell to string of next cell, because row doesn't end with days.

    But, how can I adjust range based on the month of the active sheet ?

    My values in cell containing days are formatted as d.(ddd) !
    Last edited by Lukael; 03-09-2014 at 03:50 PM.

  4. #4
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643

    Re: combobox range - type mismatch !

    Can you upload an example workbook?

    Click on GO ADVANCED and use the paperclip icon to open the upload window.

  5. #5
    Forum Contributor
    Join Date
    02-09-2014
    Location
    Kamnik, Slovenia
    MS-Off Ver
    Excel 2010
    Posts
    693

    Re: combobox range - type mismatch !

    Yes I know how to upload but the file is too large, over 1.2 Mb and can't shrinken It, otherwise everything that has to be seen in VBA will not work.

    Don't worry Norie, I will stick on code you provided, thanks a lot

+ 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. see whether a range variable is nothing ;error13 - type mismatch
    By Bishonen in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 11-20-2012, 06:58 AM
  2. Macro-created Combobox not populating; Type-Mismatch
    By Mervil in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 11-25-2010, 03:50 PM
  3. Replies: 5
    Last Post: 07-27-2010, 10:58 AM
  4. Type mismatch using rnge as Range with Type 8 Input Box
    By STEVE BELL in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 12-03-2005, 01:10 AM
  5. [SOLVED] Type mismatch on range name
    By davegb in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 06-08-2005, 02:05 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