+ Reply to Thread
Results 1 to 8 of 8

Redraw problem with user form (but probably it is my code...)

  1. #1
    Registered User
    Join Date
    12-03-2005
    Posts
    13

    Redraw problem with user form (but probably it is my code...)

    I would like to present a problem I have but it seems I can't attach anything.
    When I click on the attachment button, only a tiny empty line appears.
    I have already uploaded a file in the attachments" page but here I see nothing.

    Thanks.

    Sorry, after I sent my post on, I can see the attachment, so let me explain my little problem
    in the next post.

    Thank you..
    Attached Files Attached Files
    Last edited by FDibbins; 04-14-2017 at 01:34 PM.

  2. #2
    Registered User
    Join Date
    12-03-2005
    Posts
    13

    Redraw problem with user form (but probably it is my code...)

    Hi,
    I'm creating the userform you see but if, for instance, I select a value
    in the dropdown list and then another one in the long combo,
    you see what happens in the first photo. Even if I close the combo,
    a piece of it remains behind the form.
    (First picture)

    And if I drag around the whole form you see what I get in the second picture


    Any idea on where should I look to fix it?

    I uploaded the workbook in the previous post. (Excel 2003)

    Thanks.
    Attached Images Attached Images

  3. #3
    Forum Guru
    Join Date
    07-25-2011
    Location
    Florida
    MS-Off Ver
    Excel 2003
    Posts
    9,643

    Re: Why I can't attach an image or a zip?

    Just a thought; if a procedure sets Application.ScreenUpdating = False and does it several times without setting it back to True, then the screen may not refresh properly.
    Surround your VBA code with CODE tags e.g.;
    [CODE]your VBA code here[/CODE]
    The # button in the forum editor will apply CODE tags around your selected text.

  4. #4
    Registered User
    Join Date
    12-03-2005
    Posts
    13

    Redraw problem (but probably it is my code) [solved]

    Thank you for taking the time to look into my problem.

    You were right: that was the culprit.

    I tried and commented out alla the SU = false in the filtering and in the sorting subs
    and I put one of them at the beginnig of the click events of each option and radio button
    and of the combos. Then I put a SU = True at the end of each of the aforementioned events
    and it seems to work flawlessly.

    From that on I changed a little the way I call the different subs with different events.

    To change the sorting of the long combobox list I'm reverting back to a combo instead
    of the radio buttons. In the change event of that sorting combo I'm trying
    to fire a simple
    Please Login or Register  to view this content.
    but I can't find a way
    to dynamically build the string to put into the brackets of the run instruction: any help?

    I'll try to attach the updated wb.
    You can call the userform also doubleclicking into the FoodDb sheet.
    I usually do it in the cell "AA3000" so I can see the filtered list behaviour.

    Thanks.

    fabio
    Attached Files Attached Files

  5. #5
    Forum Guru
    Join Date
    07-25-2011
    Location
    Florida
    MS-Off Ver
    Excel 2003
    Posts
    9,643

    Re: Redraw problem (but probably it is my code) [solved]

    You're welcome. Glad it worked.

    Just to let you know; Appplication.Run is typically used to run external applications. You can call your other sub-procedures within your project by simply using the more traditional Call function e.g.; Call Group_Filtering. The Call command is actually optional. You really only need the procedure name.


    Quote Originally Posted by fabiospark View Post
    To change the sorting of the long combobox list I'm reverting back to a combo instead
    of the radio buttons. In the change event of that sorting combo I'm trying
    to fire a simple
    Please Login or Register  to view this content.
    but I can't find a way
    to dynamically build the string to put into the brackets of the run instruction: any help?
    1.) Are you asking how to build a string or pass a string?

    2.) if you are asking how to build a string, I don't understand what string you are trying to build.

  6. #6
    Registered User
    Join Date
    12-03-2005
    Posts
    13

    Re: Redraw problem (but probably it is my code) [solved]

    Quote Originally Posted by AlphaFrog View Post
    ...
    Are you asking how to build a string or pass a string?
    Yes, I probably should have said "pass" a string.

    In the "sorting" combobox I can select among this list:

    Alfabetico
    BestMatch
    Calorie
    ...

    In the click or in the change event of the combo I would like
    to call a different sorting sub according to the choice.

    I named the subs: "Sorting_by_Alfabetico"; "Sorting_by_BestMatch"
    and so on, so I am trying to pass a joint string made with the costant
    part: "Sorting_by_" and the dynamic one: UserForm2.ComboBox3.Text.

    I tried with chr(34) & "Sorting_by_" & UserForm2.ComboBox3.Text & chr(34)
    but it doesn't work.
    I also tried a few variations without success.

    Again, any help will be welcome.

    Thanks.

  7. #7
    Forum Guru
    Join Date
    07-25-2011
    Location
    Florida
    MS-Off Ver
    Excel 2003
    Posts
    9,643

    Re: Redraw problem with user form (but probably it is my code...)

    Please Login or Register  to view this content.

  8. #8
    Registered User
    Join Date
    12-03-2005
    Posts
    13

    Re: Redraw problem with user form (but probably it is my code...)

    As you can see in the WB, I have already built the Case sub and I like it because it's quite clear
    but I thought if it was possible to do the same with a single, dynamic call incorporating the text of the combo.
    But I can go on with the Case one.

    Thanks.

    Now I'm trying to create a "Settings" sheet where to store the values of a few variables.
    Looking for a way to populate the userform fields when launched, I learnt that I can't
    disable userform events directly so I have declared a boolean flag at form level and I have put
    a check of that flag in all the click (and eventually also the change) events of the controllers
    on the uf to avoid to fire them also when populating the fields with VBA. And this seems to work.

    Any advice on the best way to deal with the userform closing, both with an OK button and with
    a cancel button or with the "X"?
    With the OK I would like to write the value of combobox2 into the cell from where the form was launched
    and the value of the quantiy into a cell on the same raw but a couple of colums to the right.
    With the cancel or with the X I would do nothing or just pop up a warning, maybe with the buttons Yes or no.

    Thanks.
    Last edited by fabiospark; 04-14-2017 at 05:38 PM.

+ 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. How to attach a jpg image?
    By Joe Miller in forum Excel Charting & Pivots
    Replies: 7
    Last Post: 01-19-2017, 08:01 PM
  2. [SOLVED] Browse Button needs to attach image into worksheet
    By BalaamsDonkey in forum Excel Programming / VBA / Macros
    Replies: 22
    Last Post: 11-03-2016, 07:16 PM
  3. Replies: 6
    Last Post: 03-09-2014, 11:33 PM
  4. Attach an image to particular cell?
    By YNWA in forum Excel General
    Replies: 4
    Last Post: 06-09-2012, 08:44 PM
  5. Attach hyperlink to shape/image
    By patrickw in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 02-26-2011, 02:00 PM
  6. Attach object (eg image) to worksheet
    By usadream in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 03-27-2006, 11:08 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