+ Reply to Thread
Results 1 to 5 of 5

if commandbutton is click wiht out value, it errors out

  1. #1
    Forum Contributor
    Join Date
    10-24-2012
    Location
    San Diego, USA
    MS-Off Ver
    Excel 2019
    Posts
    844

    if commandbutton is click wiht out value, it errors out

    I have the below macro, it works and does what i need, but if the value in 'Squaretotal' is empty, then it bring out the debugger. Can someone please change the macro if user presses on the command button, it will message box 'please enter value first'.

    Please Login or Register  to view this content.

  2. #2
    Spammer
    Join Date
    10-23-2012
    Location
    Adelaide, Australia
    MS-Off Ver
    Excel 2003, Office 365
    Posts
    1,237

    Re: if commandbutton is click wiht out value, it errors out

    I have no idea what you mean by Squaretotal. Is it a named range or something?

    I think you need to post the workbook up so that we can see what and where the error is, why it's happening and then work out where the error message handler needs to go.

    If it is a named range and you just want a message to pop up if it is zero then;
    Please Login or Register  to view this content.
    I have some doubts as to what good it would do where you are intending to put it though.
    Last edited by Croweater; 09-28-2023 at 10:19 PM.

  3. #3
    Forum Contributor
    Join Date
    10-24-2012
    Location
    San Diego, USA
    MS-Off Ver
    Excel 2019
    Posts
    844

    Re: if commandbutton is click wiht out value, it errors out

    Squaretotal is an Textbox from toolbox of userform (that i see it named 'SquareTotal' on properties ) .
    I just need the If and ifElse statement written correctly on that code.
    Last edited by chubbychub; 09-29-2023 at 12:18 AM.

  4. #4
    Forum Contributor
    Join Date
    10-24-2012
    Location
    San Diego, USA
    MS-Off Ver
    Excel 2019
    Posts
    844

    Re: if commandbutton is click wiht out value, it errors out

    I guessed around to to end up correctly with your help Croweater, thank you! to see the code that i was looking for. this is the quote that i end up using:

    Please Login or Register  to view this content.

  5. #5
    Spammer
    Join Date
    10-23-2012
    Location
    Adelaide, Australia
    MS-Off Ver
    Excel 2003, Office 365
    Posts
    1,237

    Re: if commandbutton is click wiht out value, it errors out

    Well done. Glad you got it going!

+ 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] Which commandbutton click in userform
    By diegoasm11 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 03-10-2021, 12:33 AM
  2. Loop CommandButton click
    By spiklz in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 01-17-2016, 10:49 PM
  3. Call a commandbutton click event from a module
    By aman1234 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 05-19-2015, 01:10 PM
  4. Removing Item from ComboBox on CommandButton Click
    By hollyeva in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 05-17-2015, 11:06 PM
  5. Call procedure when I click any commandbutton
    By Macdave_19 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 08-22-2012, 04:33 AM
  6. Object required error on CommandButton Click
    By rkjudy in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 01-09-2011, 06:05 PM
  7. Userform Commandbutton does not update on click
    By asha3010 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 10-05-2010, 04:25 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