+ Reply to Thread
Results 1 to 9 of 9

can't figure out why this code crashes

  1. #1
    Registered User
    Join Date
    12-21-2015
    Location
    chongqing,china
    MS-Off Ver
    2013
    Posts
    7

    Unhappy can't figure out why this code crashes

    Crashes everytime I run it, not sure why. To me it looks good but not to excel.

    Please Login or Register  to view this content.
    'This is in a macro
    Last edited by bd3161; 05-09-2016 at 10:18 PM. Reason: code tags

  2. #2
    Forum Expert
    Join Date
    02-14-2009
    Location
    .
    MS-Off Ver
    ................
    Posts
    2,840

    Re: can't figure out why this code crashes

    First 2 lines are a problem
    Please Login or Register  to view this content.
    Boards rules ask you use 'Code Tags' when posting code - See item #3 on this page: http://www.excelforum.com/forum-rule...rum-rules.html

  3. #3
    Registered User
    Join Date
    12-21-2015
    Location
    chongqing,china
    MS-Off Ver
    2013
    Posts
    7

    Re: can't figure out why this code crashes

    can you elaborate?

  4. #4
    Forum Expert
    Join Date
    02-14-2009
    Location
    .
    MS-Off Ver
    ................
    Posts
    2,840

    Re: can't figure out why this code crashes

    You can 't have 2 procedure declarations like that. You must finish one (End Sub) before starting another.

    Please read the board rules

  5. #5
    Registered User
    Join Date
    04-29-2016
    Location
    Portugal
    MS-Off Ver
    2007
    Posts
    43

    Re: can't figure out why this code crashes

    Quote Originally Posted by bd3161 View Post
    Crashes everytime I run it, not sure why. To me it looks good but not to excel.
    After looking at your code I noticed some errors, I deleted this lines:
    Please Login or Register  to view this content.
    Try this code:
    Please Login or Register  to view this content.

  6. #6
    Forum Guru
    Join Date
    03-02-2006
    Location
    Los Angeles, Ca
    MS-Off Ver
    WinXP/MSO2007;Win10/MSO2016
    Posts
    12,612

    Re: can't figure out why this code crashes

    comment deleted by ben, code tags updated.
    Last edited by protonLeah; 05-10-2016 at 01:13 AM.
    Ben Van Johnson

  7. #7
    Registered User
    Join Date
    12-21-2015
    Location
    chongqing,china
    MS-Off Ver
    2013
    Posts
    7

    Re: can't figure out why this code crashes

    thanks for your help. Tried your suggestion and unfortunately, it don't work correctly. the cursor just runs to B26. It is suppose to wait on the first A cell for a change and then advance to the first B cell, wait for change and then paste that value to the A cell, then advance to next B cell, 60 times

  8. #8
    Registered User
    Join Date
    04-29-2016
    Location
    Portugal
    MS-Off Ver
    2007
    Posts
    43

    Re: can't figure out why this code crashes

    bd3161, try to explain me better what you want the code to do...

  9. #9
    Registered User
    Join Date
    12-21-2015
    Location
    chongqing,china
    MS-Off Ver
    2013
    Posts
    7

    Re: can't figure out why this code crashes

    well it was suppose to put a value in cell A20 and then set the active cell to B20 when a value is put in B20 then active cell moves to B21, when value put in B21 then active cell moves to b22, etc, etc. 60 times all changes of the active cell triggered by event change. I should note that before it moves a routine on a different machine takes place. what I am doin is weighing things on a scale so the trigger event is the number coming back from the scale

+ 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. Excel crashes when I run this code:
    By OliverBrain in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 06-05-2015, 05:17 AM
  2. Excel Crashes With Code ... PLEASE HELP!!!
    By Laingy24 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 05-08-2015, 09:35 AM
  3. Excel Crashes with my code!
    By Laingy24 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 05-06-2015, 12:57 PM
  4. Code crashes on 64 bit machine
    By blakeobeans in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 04-16-2015, 01:01 AM
  5. Replies: 4
    Last Post: 02-03-2014, 08:05 AM
  6. VBA code crashes on a different computer
    By dudamel in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 04-23-2010, 08:45 PM
  7. inserting code into code module crashes
    By Kris in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 01-25-2006, 01:30 PM

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