Results 1 to 7 of 7

Thread: Excel - Change cell formula from nested IFs to ??

Hybrid View

  1. #1

    Thread Starter
    The Devil crptcblade's Avatar
    Join Date
    Aug 2000
    Location
    Quetzalshacatenango
    Posts
    9,091

    Re: Excel - Change cell formula from nested IFs to ??

    Quote Originally Posted by RobDog888
    I need more info on what type of event you need to call this from.
    It would need to be a replacement for a formula in a range of cells. Basically, each cell in column K has that formula in it, but new values will be getting added regularly, and I don't want to have to maintain that big IF statement.

    The only event I found was Sheet_Calculate, but I don't know how to figure out which cell has changed in order to update it.


    As for the teeth, please transfer $458 for s/h to my Paypal and they are as good as yours.
    Laugh, and the world laughs with you. Cry, and you just water down your vodka.


    Take credit, not responsibility

  2. #2

    Thread Starter
    The Devil crptcblade's Avatar
    Join Date
    Aug 2000
    Location
    Quetzalshacatenango
    Posts
    9,091

    Re: Excel - Change cell formula from nested IFs to ??

    Resolved by me. I figured out how to link a function in a module to the formula.

    So I'll keep the teeth.

    :evil:
    Laugh, and the world laughs with you. Cry, and you just water down your vodka.


    Take credit, not responsibility

  3. #3
    Addicted Member
    Join Date
    Jan 2002
    Location
    Glasgow, Scotland
    Posts
    202

    Re: Excel - Change cell formula from nested IFs to ??

    hi,

    can you post how you achieved the resolution?

    I would be interested to know.

    Thnx
    if you fail to plan, you plan to fail

  4. #4

    Thread Starter
    The Devil crptcblade's Avatar
    Join Date
    Aug 2000
    Location
    Quetzalshacatenango
    Posts
    9,091

    Re: Excel - Change cell formula from nested IFs to ??

    Quote Originally Posted by Br1an_g
    hi,

    can you post how you achieved the resolution?

    I would be interested to know.

    Thnx
    It actually turned out to be pretty easy. Add a module, and make a public function.
    Code:
     Public Function ReturnSomeValue(CellValue) As Double
       ReturnSomeValue = Val(CellValue) * 2.24
     End Function
    Then make the formula in the cell "=ReturnSomeValue(H4)" and it should work fine. I guess it gets a little hinky passing ranges of cells in, I only needed to worry about one cell at a time.
    Laugh, and the world laughs with you. Cry, and you just water down your vodka.


    Take credit, not responsibility

  5. #5
    Ex-Super Mod RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,709

    Re: Excel - Change cell formula from nested IFs to ??

    Quote Originally Posted by crptcblade
    Resolved by me. I figured out how to link a function in a module to the formula.

    So I'll keep the teeth.

    :evil:
    Geez, you welch on the teeth and you dont want to share the solution. Boooo *SLAP*

    Should I give you -Teeth then
    VB/Office Guru™ (AKA: Gangsta Yoda®)
    I dont answer coding questions via PM. Please post a thread in the appropriate forum.

    Microsoft MVP 2006-2011
    Office Development FAQ (C#, VB.NET, VB 6, VBA)
    Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
    If a post has helped you then Please Rate it!
    Reps & Rating PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI Viewer utility.NET API Viewer Utility
    System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6

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