+ Reply to Thread
Results 1 to 12 of 12

Last row < 33 Stop macro

Hybrid View

  1. #1
    Registered User
    Join Date
    12-19-2014
    Location
    US
    MS-Off Ver
    2010 Suite
    Posts
    28

    Last row < 33 Stop macro

    Hello,

    I have a series of macros but want to insert a stop macro if the last row < 33 rows. Then it will give me a message box "Not Enough Film".

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

    Re: Last row < 33 Stop macro

    If Cells(Rows.Count, 1).End(xlUp).Row<33 Then MsgBox "Not Enough Film!":Exit Sub

  3. #3
    Registered User
    Join Date
    12-19-2014
    Location
    US
    MS-Off Ver
    2010 Suite
    Posts
    28

    Re: Last row < 33 Stop macro

    I ran this macro and when i posted the macro in the series of macros I have. It still proceeds to calculate. I want the macro to stop at that point before it proceeds. Can you help me with that?

    Step 1: Deletes Zeros
    Step 2: Stop Macro
    Step 3: Calculate

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

    Re: Last row < 33 Stop macro

    Need a lot more information on what you need.
    BTW, you say "Calculate". Is your calculation set to manual or do you mean something else.

  5. #5
    Registered User
    Join Date
    12-19-2014
    Location
    US
    MS-Off Ver
    2010 Suite
    Posts
    28

    Re: Last row < 33 Stop macro

    The calculation is set to calculate in the macro. When I press the macro the series of macros starts to process as follows: (Macro 1) Deletes zeros (Macro 2) Stop Macro (Macro 3) calculates for gel number. We have a macro that takes out all the test data that is not good for instance all the zero data. Then after that I want to put a stop macro after so that it does not proceed to the next step which is the calculate. I need at least 33 rows in my spreadsheet to calculate. Sometimes we have data that does not have enough lines as in 33 rows so it does not calculate right. So thats why I want a stop macro that it stops completely so that it does not calculate. Thats why I have a message that says not enough film.

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

    Re: Last row < 33 Stop macro

    Is there a good reason to have different macros running one after another? You cant have a single macro to everything?
    So something like this?
    Sub gdclyde()
    ActiveSheet.UsedRange.CellsWithZero.Delete
    If ActiveSheet.UsedRange.Rows.Count<33 Then MsgBox "Insufficient info, please finish!":Exit Sub
    Calculate gel number
    End Sub

  7. #7
    Registered User
    Join Date
    12-19-2014
    Location
    US
    MS-Off Ver
    2010 Suite
    Posts
    28

    Re: Last row < 33 Stop macro

    Im sorry I think I am getting you mixed up. All I need is a macro that gives me a stop code from proceeding. If the last row is < 33 stop the macro. If > 33 then proceed to next step in the macro. All I need is this step. I have a list of macros that do specific things. So when I press the master macro it does the following.
    Macro1: Deletes Zeros (I have the macro for this one)
    Macro2: Stop macro from proceeding if last row is < 33, or if > 33 then proceed to next step (This step I need a macro for)
    Macro3: calculate (I have the macro for this one)

    Thanks

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

    Re: Last row < 33 Stop macro

    Re: All I need is a macro that gives me a stop code from proceeding
    See Post #2

  9. #9
    Registered User
    Join Date
    12-19-2014
    Location
    US
    MS-Off Ver
    2010 Suite
    Posts
    28

    Re: Last row < 33 Stop macro

    I ran that macro but the macro still proceeds to the next step which is calculating. The macro should stop and not proceed if the last row is < 33. If it is > 33 then it would go to the next step which is calculating.

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

    Re: Last row < 33 Stop macro

    Show us all code you have.

  11. #11
    Registered User
    Join Date
    12-19-2014
    Location
    US
    MS-Off Ver
    2010 Suite
    Posts
    28

    Re: Last row < 33 Stop macro

    'This is the order of my macro
    HTML Code: 
    HTML Code: 
    HTML Code: 
    HTML Code: 
    HTML Code: 
    HTML Code: 
    'This is all my macros

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

    Re: Last row < 33 Stop macro

    I am sorry. I don't understand why all these different macros. I am sure that if you just combine everything into one macro it'll make everything easier to understand, for me anyway.
    Maybe someone else can help you because I am lost for ideas.

+ 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. Replies: 2
    Last Post: 11-03-2014, 12:06 PM
  2. If cell contains text string then run macro, otherwise stop macro and popup message
    By justindk in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 01-15-2014, 08:20 AM
  3. Converting workbook with Macro to a template causes the Macro to stop working
    By Skeeta in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 11-20-2012, 02:00 PM
  4. Macro to check Entire Column Q for 0 and stop macro
    By L2012 in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 10-06-2012, 12:36 PM
  5. [SOLVED] Call another Macro or Stop Macro Based on MsgBox Yes or No
    By GStone in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 05-03-2012, 05:59 PM
  6. Stop Macro, Select Cell, Restart Macro
    By tenk283 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 09-26-2010, 12:48 AM
  7. Stop Macro, Check Cells & Modify if Necessary, Resume Macro
    By AccountantCost in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 11-08-2009, 07:39 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