+ Reply to Thread
Results 1 to 8 of 8

Macro to Fill with Formula, but Hide Formula to User

  1. #1
    Forum Contributor
    Join Date
    09-06-2012
    Location
    New York
    MS-Off Ver
    Excel 2007
    Posts
    225

    Red face Macro to Fill with Formula, but Hide Formula to User

    I would like to populate the F column with the following formula pulling from the same row in column E, but cant have the formula visible to the user. How can I create a macro to have the corresponding value fill in for the data set? Should I use a loop?

    Any help is much appreciated.



    Formula: copy to clipboard
    Please Login or Register  to view this content.


    Thank you,

    Nick

  2. #2
    Forum Contributor
    Join Date
    09-06-2012
    Location
    New York
    MS-Off Ver
    Excel 2007
    Posts
    225

    Macro to Fill Column with Formula

    I would like to fill column F with the resulting value from the following formula:

    Formula: copy to clipboard
    Please Login or Register  to view this content.


    The only catch is that the formula cannot be visible from the worksheet.

    Thank you for taking a look.

  3. #3
    Forum Contributor Jack7774's Avatar
    Join Date
    08-31-2012
    Location
    Georgia, US
    MS-Off Ver
    Excel 2010
    Posts
    576

    Re: Macro to Fill Column with Formula

    I am new here but i think you don't want the formula to be seen if the cell E2 is blank right? If yes then change your formula to this

    Please Login or Register  to view this content.

  4. #4
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643
    What do you mean the formula can't be visible from the worksheet?
    If posting code please use code tags, see here.

  5. #5
    Forum Contributor
    Join Date
    09-06-2012
    Location
    New York
    MS-Off Ver
    Excel 2007
    Posts
    225

    Re: Macro to Fill Column with Formula

    Norie,

    In column F I want the values created by the formula to show. When you click on the cell, I want the value to show up in the function bar, rather than the formula being visible. Any ideas on how to make a macro perform this?

  6. #6
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: Macro to Fill Column with Formula

    you could just protect the cell and hide the formula then protect the sheet
    "Unless otherwise stated all my comments are directed at OP"

    Mojito connoisseur and now happily retired
    where does code go ?
    look here
    how to insert code

    how to enter array formula

    why use -- in sumproduct
    recommended reading
    wiki Mojito

    how to say no convincingly

    most important thing you need
    Martin Wilson: SPV
    and RSMBC

  7. #7
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643

    Re: Macro to Fill Column with Formula

    So you want the code to put the formula in then replace it with values?
    Please Login or Register  to view this content.

  8. #8
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS365 Family 64-bit
    Posts
    24,721

    Re: Macro to Fill with Formula, but Hide Formula to User

    There are two approaches to this. One is to use a loop to provide the result of this formula to all cells in column F, one time. This is only a good idea if you know the data in column E will not change. Another way is to detect any time the data in column E changes, and then update the cell in column F. Maybe you even need both; here they are.

    Please Login or Register  to view this content.
    Jeff
    | | |會 |會 |會 |會 | |:| | |會 |會
    Read the rules
    Use code tags to [code]enclose your code![/code]

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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