+ Reply to Thread
Results 1 to 7 of 7

Trouble with Buttons on my simple math worksheet.

  1. #1
    Registered User
    Join Date
    04-29-2020
    Location
    Ft Worth, Texas
    MS-Off Ver
    2020
    Posts
    3

    Question Trouble with Buttons on my simple math worksheet.

    Hi,

    I'm having a bit of trouble with VBA and I'm hoping someone can help me out. I'm working on a simple Math worksheet for my kiddo and was experimenting with VBA in that I have "next" and "previous" buttons to go from math problem to math problem. I had little trouble in getting the math problems to go forward or backward, where my problem lies is that I'm trying to disable the "next" button until kiddo gets the right answer on the current problem. I tried (In vain) to do this by using an If statement that either enabled or disabled the button depending on what value was in the answer box. If the answer is correct, the Next button enables. If the answer is incorrect, then the Next button is disabled. I would also like to have some visual indicator of this, such as the button becoming transparent or greyed out. Any help would be very appreciated. Example below.
    Attached Files Attached Files
    Last edited by drgrisham86; 04-29-2020 at 04:31 PM.

  2. #2
    Forum Expert
    Join Date
    10-06-2008
    Location
    Canada
    MS-Off Ver
    2007 / 2013
    Posts
    5,519

    Re: Trouble with Buttons on my simple math worksheet.

    I would:
    This is more or less a must. Get rid of the Merged Ranges. They will get you into trouble. Lots of google results around about this.
    Put you data from Columns P:T into another (next) sheet.
    Have you "Next Problem" Arrow colored Green as soon as the answer In G6 is right. Otherwise have it red.
    It will turn red when clicking on it to bring the next problem up.
    Code behind it will stay disabled as long as there is no answer or the answer is wrong.
    Change your left pointing Right Arrow (Previous Problem) to a left pointing Left Arrow!

    I am busy for the next little while so if no one else jumps in with a solution, I'll have a look tomorrow.

  3. #3
    Registered User
    Join Date
    04-29-2020
    Location
    Ft Worth, Texas
    MS-Off Ver
    2020
    Posts
    3

    Re: Trouble with Buttons on my simple math worksheet.

    Thank you for your assistance.
    I got rid of the merged ranges and moved the array to Sheet 2.
    I replaced the upside down right arrow with an actual left arrow. And colored the "NEXT" (right) arrow red.
    I also recorded two macros, one to turn the arrow to green from red and one to turn it from red to green.
    However, I have no idea how to implement that into VBA or how to automate it so that it changes when the solution cell has the correct value in it.
    Nor have I been able to figure out how to disable the "NEXT" button until the solution is correct. I will re-upload the sheet with the changes.

    Again, any help would be greatly appreciated.
    Attached Files Attached Files

  4. #4
    Forum Guru
    Join Date
    09-10-2017
    Location
    Chippenham, England
    MS-Off Ver
    365
    Posts
    15,075

    Re: Trouble with Buttons on my simple math worksheet.

    Hi 7 welcome to the board.
    If you put this formula in A6 (you can change the font colour to white if you want.
    =VLOOKUP(D2,Solutions!A2:E41,5,FALSE)=G6

    and then put this code in the sheet module for the problems sheets
    Please Login or Register  to view this content.

  5. #5
    Registered User
    Join Date
    04-29-2020
    Location
    Ft Worth, Texas
    MS-Off Ver
    2020
    Posts
    3

    Re: Trouble with Buttons on my simple math worksheet.

    Fluff13,

    Thanks so much for your help!

  6. #6
    Forum Guru
    Join Date
    09-10-2017
    Location
    Chippenham, England
    MS-Off Ver
    365
    Posts
    15,075

    Re: Trouble with Buttons on my simple math worksheet.

    You're welcome & thanks for the feedback.

  7. #7
    Forum Expert
    Join Date
    10-06-2008
    Location
    Canada
    MS-Off Ver
    2007 / 2013
    Posts
    5,519

    Re: Trouble with Buttons on my simple math worksheet.

    I guess I was thinking on a lower level than Fluff13

    But I started so I should finish.
    Attached is my idea.
    Attached Files Attached Files

+ 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. [SOLVED] Simple math formula
    By nur2544 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 10-26-2013, 10:18 PM
  2. Very simple math equals #value! ???
    By jonvanwyk in forum Excel General
    Replies: 2
    Last Post: 12-12-2010, 05:19 PM
  3. Excel 2007 : Simple math problem
    By kingbob in forum Excel General
    Replies: 1
    Last Post: 09-10-2009, 03:21 PM
  4. Simple Math Addition
    By ssjody in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 07-21-2006, 05:12 AM
  5. Replies: 3
    Last Post: 02-16-2006, 07:00 AM
  6. [SOLVED] Need help, simple math...from a percentage
    By cfiser in forum Excel General
    Replies: 2
    Last Post: 11-17-2005, 12:55 PM
  7. Incorrect Simple Math
    By mklalli in forum Excel General
    Replies: 4
    Last Post: 11-12-2005, 09:30 AM
  8. [SOLVED] Simple math calculation - 50/50?
    By Abi in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 02-09-2005, 03:06 PM

Tags for this Thread

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