+ Reply to Thread
Results 1 to 4 of 4

Macro: Running a formula/argument

Hybrid View

  1. #1
    Registered User
    Join Date
    11-01-2011
    Location
    USA
    MS-Off Ver
    Excel 2004 for Mac
    Posts
    41

    Macro: Running a formula/argument

    I'd like to insert the following argument into a coded module, but I cannot figure out how to code it. Would someone please give me a hand?

    =IF(OR($F38="36x48 POD size",$F38="30x40 POD size",$F38="42x56 Pod size",$F38="48x64 Pod size"),"XL Moab POD Substrate","")
    The argument will be absolute in cell H38, or in $H38

    All best and thanks so much for the help!
    Last edited by firehousetk; 11-02-2011 at 01:56 PM.

  2. #2
    Forum Expert davegugg's Avatar
    Join Date
    12-18-2008
    Location
    WI, US
    MS-Off Ver
    2010
    Posts
    1,884

    Re: Macro: Running a formula/argument

    Did you try the macro recorder?

    Sub Macro1()
    '
    ' Macro1 Macro
    '
    
    '
        Cells(38, "H").FormulaR1C1 = _
            "=IF(OR(RC6=""36x48 POD size"",RC6=""30x40 POD size"",RC6=""42x56 Pod size"",RC6=""48x64 Pod size""),""XL Moab POD Substrate"","""")"
    
    End Sub
    Is your code running too slowly?
    Does your workbook or database have a bunch of duplicate pieces of data?
    Have a look at this article to learn the best ways to set up your projects.
    It will save both time and effort in the long run!


    Dave

  3. #3
    Registered User
    Join Date
    11-01-2011
    Location
    USA
    MS-Off Ver
    Excel 2004 for Mac
    Posts
    41

    Re: Macro: Running a formula/argument

    I did, but got something a little different than your code. I think I've got the argument wrong, though. It's running, but giving me a FALSE when it should be giving me a TRUE. Thanks again.

  4. #4
    Forum Expert davegugg's Avatar
    Join Date
    12-18-2008
    Location
    WI, US
    MS-Off Ver
    2010
    Posts
    1,884

    Re: Macro: Running a formula/argument

    The only thing I changed on my code was the target cell where the formula is going; I set it to cell H38 instead of the active cell. I copied your formula, so there is no reason it should not be working.

    Maybe you could post an example of it not working?

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

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