Excel (maybe Numbers) Help - For a project

Posted:
in General Discussion edited January 2014
Here is what I want to do



My guess is it would have to be done with Excel



Also-- My guess is it would be with a 'macro'



But what I want to do is create an instance where if 5 minutes go by with INACTIVITY I can have a script that would 'tell' cell A4, G6, H4 to be set to zero



If not that -- backup idea-- If they press a button -- the script would run and set the cell to zero

Comments

  • Reply 1 of 7
    nvidia2008nvidia2008 Posts: 9,262member
    Quote:
    Originally Posted by M.O.S.T View Post


    Here is what I want to do



    My guess is it would have to be done with Excel



    Also-- My guess is it would be with a 'macro'



    But what I want to do is create an instance where if 5 minutes go by with INACTIVITY I can have a script that would 'tell' cell A4, G6, H4 to be set to zero



    If not that -- backup idea-- If they press a button -- the script would run and set the cell to zero



    Button is easiest, it triggers Visual Basic actions which sets those cell contents = "" (equals to blank string). Quite doable. Sorry got no brain power today for further help.
  • Reply 2 of 7
    nvidia2008nvidia2008 Posts: 9,262member
    There *could* be an ultracool Cocoa app integrated with AppleScript you could write to do this too, probably. 1337 stuff.
  • Reply 3 of 7
    nvidia2008nvidia2008 Posts: 9,262member
    Actually I just installed Numbers. AppleScript into Numbers might the coolest way to do this, I reckon. Exactly how, I have no clue. \
  • Reply 4 of 7
    this macro should be what you need. You can probably get apple script to run it every 5 minutes. I'll check for you.





    Sub zero()

    '

    ' zero Macro

    ' Macro recorded 8/20/2007 by Dana Dixon

    '



    '

    Range("A1").Select

    ActiveCell.FormulaR1C1 = "=0"

    Range("G6").Select

    ActiveCell.FormulaR1C1 = "=0"

    Range("H4").Select

    ActiveCell.FormulaR1C1 = "=0"

    Range("H5").Select

    End Sub
  • Reply 5 of 7
    Ok this should work, open apple script editor and follow the example:



    repeat until false

    \ttell application "Microsoft Excel"

    \t\ttell workbook "testzero"

    \t\t\trun VB macro "zero"

    \t\tend tell

    \tend tell

    \tdelay 300

    end repeat



    note: my excel doc is called "testzero" and my macro is named "zero". The data for the cell must already be entered(if the cursor is flashing in the cell it won't work). If you want to to work on any workbook open, change {tell workbook "testzero"} to {tell active workbook}



    Good luck
  • Reply 6 of 7
    doh, just relized you wanted it to reset after inactivity, not sure how to do that... My script will just run the macro every 5 minutes.
  • Reply 7 of 7
    is the data being entered into the cell done manually or is it a result of a formula? There is a VB trigger called Worksheet_Change, that may help if the data is entered manually.
Sign In or Register to comment.