+ Reply to Thread
Results 1 to 5 of 5

Userform - checkbox & texbox value in range

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

    Userform - checkbox & texbox value in range

    Hello,

    I have userform which shows days in month & populated Listbox for cell values. I want checkboxes to be ticked and Textbox to count when conditions are met, for each day. Range is, example (for 1st day) from E3:E318. My code so far is :

    Please Login or Register  to view this content.
    So, When "MIN1" reaches value of 2, checkbox is ticked - If more than 2 then Msgbox ; When "MIN5", I want to be counted in Texbox ;

    Anybody have any ideas, suggestions ? I'm quite a beginner in VBA, really struggling with this one, too much for me I guess...

    I attached sample worksheet with Userform, code is too long to post It here !

    Any help much appreciated, I hope I was clear...

    Thanks in advance !

    Regards, Luka
    Last edited by Lukael; 03-01-2014 at 01:49 AM.

  2. #2
    Forum Guru HaHoBe's Avatar
    Join Date
    02-19-2005
    Location
    Hamburg, Germany
    MS-Off Ver
    2013 on Win10 (desktop), 2007 on Win10 (notebook)
    Posts
    8,099

    Re: Userform - checkbox & texbox value in range

    Hi, Luka,

    maybe you can attach a sheet that shows some data as the sheet you provided only holds the Dates and two names but no appointments.

    Besides:
    - I dislike merged cells as they will sooner or later interfere with easy coding
    - I usually recommend to use Option Explicit via Settings in the VBE (in your case you would have noticed that itīs not x1up but xlUp (not the number 1 but a small L)

    The problems that occur are due to your use of converted date values as cell references but I think it could be better explained if you give us some data to play with.

    Ciao,
    Holger
    Use Code-Tags for showing your code: [code] Your Code here [/code]
    Please mark your question Solved if there has been offered a solution that works fine for you

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

    Re: Userform - checkbox & texbox value in range

    Hi HaHoBe,

    thanks for your response.

    I have attached now another sample, this one is almost finished, I hope you'll get a real picture now.

    I merged cells only because original workbook looked very ugly, so I've done a little makeup to It.

    Yes, I have noticed that mistake in x1up, but I think that is not issue, I guess It wouldn't even work. Probably the correct solution for my Userfom is Looping through columns in a specified range, but I've done like 1000 things in VBA and nothing correct. I've done some programming in VB 6 which I think is a little bit more of "helpful" in terms of programming, because or error interpreter, at least for me It was.

    You'll notice that I have another macro for creating months of year - the year you put in A1 will be created with button next to It. If you have a little more time, please check that out too and see If everything is ok. It should generate sheets for months, and delete all cells as In code. Code works as I want, the only problem is that days are generated within range of first sheet as I copy It and rename It, so 31 days are copied into every new sheet, which is wrong, all months don't have same number of days. I tried deleting columns, but cannot perform that only on the columns where are redundant days, because I have needed columns after that.

    Anyway, thanks for all your help, if there is anything I can do for you, please tell

    Attached worksheet is not quite finished as I changed It a lot, but this file has most corrections on it, I hope It works !

  4. #4
    Forum Guru HaHoBe's Avatar
    Join Date
    02-19-2005
    Location
    Hamburg, Germany
    MS-Off Ver
    2013 on Win10 (desktop), 2007 on Win10 (notebook)
    Posts
    8,099

    Re: Userform - checkbox & texbox value in range

    Hi, Lika,

    some small alterations made to the workbook: I deleted the blanks listed in Column B and only allowed cells to be listed which have a length greater than zero.

    Please Login or Register  to view this content.
    I inserted a Label above the date to show the information about month and year.

    Ciao,
    Holger
    Attached Files Attached Files

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

    Re: Userform - checkbox & texbox value in range

    Thanks a lot HaHoBe, you're The man, danke Deutchland !

    Great about blanks in column B, I was actually planning to do that. I will still make some changes in code for both macros, but only few minor things.

    And special thanks for:

    Please Login or Register  to view this content.
    ....You brightened my narrow thinking with that, It solved my other problems

+ 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. To use the mouse wheel in a VBA Userform to navigate in my Texbox
    By CKL67 in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 12-02-2016, 12:36 PM
  2. [SOLVED] showing message box if the result of texbox doesn't match with the range then clear texbox
    By hamidrezaxy in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 06-20-2013, 01:04 PM
  3. Copy Checkbox and change texbox link
    By t0m46 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 09-07-2010, 06:51 AM
  4. Userform Texbox Collection?
    By ions in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 05-04-2009, 12:54 PM
  5. UserForm TexBox formating
    By pacharbo in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-15-2007, 04:44 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