+ Reply to Thread
Results 1 to 14 of 14

Why does screen move when first row of code turns movement off

  1. #1
    Valued Forum Contributor
    Join Date
    09-04-2007
    Location
    Ontario, Ca
    Posts
    624

    Why does screen move when first row of code turns movement off

    The following is my code. Maybe I'm too tired since it's 4:50 am. Everything else in the code works correctly.

    Please Login or Register  to view this content.
    Last edited by Launchnet; 12-13-2011 at 03:51 PM.
    Thanks for helping . . .
    Matt @ Launchnet

  2. #2
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200

    Re: Why does screen move when first row of code turns movement off

    Application.ScreenUpdating will prevent the flickering caused by the screen updating, it can improve code efficiency. I didn't really notice any movement with your code. However, this code doesn't select the ranges & therefore will work more smoothly.

    Please Login or Register  to view this content.
    Hope that helps.

    RoyUK
    --------
    For Excel Tips & Solutions, free examples and tutorials why not check out my web site

    Free DataBaseForm example

  3. #3
    Valued Forum Contributor
    Join Date
    09-04-2007
    Location
    Ontario, Ca
    Posts
    624

    Re: Why does screen move when first row of code turns movement off

    Good Morning RoyUK . . .

    Thanks for the very Clean code. Works like a charm.

    When I went back to sleep around 5 am here in California, I woke up later with an enhancement if possible.

    It would be nice to have a dual function on my macro button, just like a toggle switch.

    1st click would do exactly as current code.
    2nd click would unhide all columns

    If this is not possible, I will have to have a separate button that does it, which I can code.

    No need to read the following unless you want to see a brief description of what our database does, if you are interested.

    By the way, there are approximately 24 different buttons on my Dashboard that selects 24 different Ministries in our church. Each button selects a different range that is used by that particular Ministry. I will copy the code to each Ministry button and simply change the range.

    I have been told that with all these columns, the program could become unruly, but with this type of selection, the user only deals with the 6 to 10 columns at a time. It really works great. In the Men's Ministry, we even track attendance with a double-click of the mouse for each person in weekly attendance. Then, when all attendees have an x in the attendance column, I click another button that calculates # of times attended in a row - or - how many misses in a row, plus year-to-date attendance.

    We can send emails, print reports, and the list goes on. We can even track and eliminate sending any particular email going to a member that elects to not receive 1 or more of the 10 different types of emails we send out.

    And the features go on and on.

    I've really enjoyed building this database.

    And, I really appreciate all the help everyone has given me.

    With much respect.

    Matt

  4. #4
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200

    Re: Why does screen move when first row of code turns movement off

    Do you mean
    Please Login or Register  to view this content.

  5. #5
    Valued Forum Contributor
    Join Date
    09-04-2007
    Location
    Ontario, Ca
    Posts
    624

    Re: Why does screen move when first row of code turns movement off

    RoyUK . . .
    Great Code . . .

    Question . . . Inserting code on Quick Reply. I can't find the symbol that gives the background around code like when I write a new thread.

    All 3 lines of code are very clean and work perfectly.

    Many thanks.

  6. #6
    Valued Forum Contributor
    Join Date
    09-04-2007
    Location
    Ontario, Ca
    Posts
    624

    Re: Why does screen move when first row of code turns movement off

    OK, I just looked at reply and I find the # function. I assume that if entering code I have to go thru Reply.

    Thanks

  7. #7
    Valued Forum Contributor
    Join Date
    09-04-2007
    Location
    Ontario, Ca
    Posts
    624

    Re: Why does screen move when first row of code turns movement off

    It was working fine until I added a 2nd macro . . . See Below

    Please Login or Register  to view this content.
    There must be a conflict of some kind. I can't see why.

  8. #8
    Valued Forum Contributor
    Join Date
    09-04-2007
    Location
    Ontario, Ca
    Posts
    624

    Re: Why does screen move when first row of code turns movement off

    Sorry if you seen my note stating there was a conflict.

    My problem. I linked the second macro to the wrong macro.

    Very Very Sorry

  9. #9
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200

    Re: Why does screen move when first row of code turns movement off

    Your post does not comply with Rule 9 of our Forum RULES. If you solve a problem yourself before anyone else has responded, please take a moment to describe your solution, chances are some other member will benefit. And please never edit a thread in which someone else has responded.


    How to mark a thread Solved
    Go to the first post
    Click edit
    Click Go Advanced
    Just below the word Title you will see a dropdown with the word No prefix.
    Change to Solved
    Click Save

  10. #10
    Valued Forum Contributor
    Join Date
    09-04-2007
    Location
    Ontario, Ca
    Posts
    624

    Re: Why does screen move when first row of code turns movement off

    RoyUK . . .

    Good Morning

    I need to re-open this thread, but I'm not sure how to. So, I am explaining my problem below in hope that you will see it. I am also going to send you a personal note on how to do this.

    Matt

    The reason I marked this Thread SOLVED, was because it worked perfect with your single line of code. But, now I have made a second macro with the same code, with different ranges. Now, I have problems if I don't use the same macro to return to home position (no columns hid).

    Users are bound to jump between macros so this is a problem.

  11. #11
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200

    Re: Why does screen move when first row of code turns movement off

    Attach the workbook & I'll take a look

  12. #12
    Valued Forum Contributor
    Join Date
    09-04-2007
    Location
    Ontario, Ca
    Posts
    624

    Re: Why does screen move when first row of code turns movement off

    Good Morning from California royuk . . .

    I wish I had used a better title, the screen movement or shaking has gone away, but the macros that we were and are talking about still has a problem.

    If I were to send you a copy of my workbook, you would have so many questions that I think it best that I 1st try to give you a better description. A sample workbook would also be difficult to produce.

    The # sign followed by a number value is referring to different Replys on the Post.

    #2 Works Good
    Then I asked for the same action, but I wanted the macro to have a toggle function.

    #3 I tried to just give you some general overview or info on the things happening in my program
    #4 Works perfect
    #7 Since the one macro that you started with was so good, I attempted to have 2 macro buttons with different ranges to be hidden. Actually, when finished, the program will have 24 different buttons (macros) on the Dashboard. I added the Range line of code as the cell selection sometimes was hidden along with the columns hidden.

    If I click the button (macro) "GoToMensMinistry" it works perfectly. The correct columns are hidden.

    If I click the same button a second time it works perfectly. All columns are displayed.

    Same is true on "GoToCompanyInfo" if I do exactly the same as done with "GoToMensMinistry. It works perfect.

    MY PROBLEM . . .

    Example: If I click "GoToMensMinistry" and then the user does not click it a second time, but instead clicks "GoToCompanyInfo" the range to be hidden selection gets mixed up. Sometimes if I go back and forth between these 2 macros, I get the display of the opposite macro. It's in consistent.

    If the user always clicked the same button to return to home base, there would not be a problem. But, users don't always do what they are supposed to.

    If I keep each macro seperate as in #4, I would have to add a line of code at the beginning of the macro to 1st clear all hidden columns. Then, I would need a single button that would clear all hidden columns and return to home position, other wise the user could not unhide hidden columns. This I could do.

    I hope this is more enlightening.

    5:45 am and I'm going back to bed for about 2 hours moe sleep.

    Thanks Roy

  13. #13
    Forum Expert snb's Avatar
    Join Date
    05-09-2010
    Location
    VBA
    MS-Off Ver
    Redhat
    Posts
    5,649

    Re: Why does screen move when first row of code turns movement off

    1. you'd better specify the sheet you are working in.
    2. use simpler code:
    to unhide all columns:
    Please Login or Register  to view this content.
    3. Like:
    Please Login or Register  to view this content.
    Please Login or Register  to view this content.



  14. #14
    Valued Forum Contributor
    Join Date
    09-04-2007
    Location
    Ontario, Ca
    Posts
    624

    Re: Why does screen move when first row of code turns movement off

    The following 3 macros does the job. I added a Button to unhide all columns. This is necessary to unhide all hidden columns and select column A - same row which is considered being at home on the same rown that was last used.

    On the other 2 macros I added the 1st row of code in each of the other 2 macros


    Please Login or Register  to view this content.
    I will test for a few days and if it continues to work perfectly, I will mark the Thread SOLVED.

    Many Thanks

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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