Results 1 to 5 of 5

Thread: formula field can do action

  1. #1

    Thread Starter
    Member
    Join Date
    Jan 2006
    Posts
    37

    formula field can do action

    can a formula field execute a script? or do some action such as making a dialog box note ?

  2. #2
    PowerPoster Radjesh Klauke's Avatar
    Join Date
    Dec 2005
    Location
    Sexbierum (Netherlands)
    Posts
    2,244

    Re: formula field can do action

    VB Code:
    1. If Range("A1").value = 1 then 'call action
    The result of your formula should be 1 in this case.

    Very small example:
    VB Code:
    1. If range("A1").value = 1 then
    2.    MessagBox "Range("A1").Value = 1", vbinformation +vbokonly, "Message"
    3. End if
    Hope this is what you are looking for.


    If you found my post helpful, please rate it.

    Codebank Submission: FireFox Browser (Gecko) in VB.NET, Load files, (sub)folders treeview with Windows icons

  3. #3

    Thread Starter
    Member
    Join Date
    Jan 2006
    Posts
    37

    Re: formula field can do action

    Quote Originally Posted by Radjesh Klauke[Highlight=VB
    If range("A1").value = 1 then
    MessagBox "Range("A1").Value = 1", vbinformation +vbokonly, "Message"
    End if[/Highlight]
    where would you write the vbcode in the macro environment(VBA ide) ?

  4. #4
    PowerPoster Radjesh Klauke's Avatar
    Join Date
    Dec 2005
    Location
    Sexbierum (Netherlands)
    Posts
    2,244

    Re: formula field can do action

    The page where you want to execute the code. If the formula is in page one place the code in the IDE also on page one.


    If you found my post helpful, please rate it.

    Codebank Submission: FireFox Browser (Gecko) in VB.NET, Load files, (sub)folders treeview with Windows icons

  5. #5
    Frenzied Member zaza's Avatar
    Join Date
    Apr 2001
    Location
    Borneo Rainforest Habits: Scratching
    Posts
    1,486

    Re: formula field can do action

    Also be aware that each worksheet has a Worksheet_Change event which fires every time a cell is changed. This event returns a range named Target to tell you which range was changed, so you can use this to trap changes in cells and cause code to action accordingly.

    zaza

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width