+ Reply to Thread
Results 1 to 11 of 11

Macro to change formula to value

  1. #1
    Forum Contributor
    Join Date
    02-21-2007
    MS-Off Ver
    Microsoft 365 Apps for enterprise
    Posts
    389

    Macro to change formula to value

    Hello,

    AS per the attchement, I add a date in the cell H2 and when I select in the cell I2 the date in the column K changes as per the =IF formula..

    My question is the following: Would it be possible, once I select the option in I2 to have the formulas in the column K changed for value? I put a example recording a macro!

    HTML Code: 
    I really wish to have that automaticaly done once I select the option in I2 without running manually a button.

    Many Thanks in advance,
    Graig
    Attached Files Attached Files

  2. #2
    Forum Expert
    Join Date
    04-22-2013
    Location
    .
    MS-Off Ver
    .
    Posts
    4,418

    Re: Macro to change formula to value

    Hi, I think if you put something like:
    Please Login or Register  to view this content.
    In the sheet object module.

  3. #3
    Forum Contributor
    Join Date
    02-21-2007
    MS-Off Ver
    Microsoft 365 Apps for enterprise
    Posts
    389

    Re: Macro to change formula to value

    Can you combine the macro with the existing one??
    HTML Code: 

  4. #4
    Forum Expert
    Join Date
    04-22-2013
    Location
    .
    MS-Off Ver
    .
    Posts
    4,418

    Re: Macro to change formula to value

    Please Login or Register  to view this content.

  5. #5
    Forum Contributor
    Join Date
    02-21-2007
    MS-Off Ver
    Microsoft 365 Apps for enterprise
    Posts
    389

    Re: Macro to change formula to value

    The only thing I miss is to apply the macro to the entire column: the cell I2 to the column--> I:I and K2:K4 to the column --> K:K.

    Would it be possible to apply the macro to the entire columns?

    Many Thanks,
    Graig

  6. #6
    Forum Expert
    Join Date
    04-22-2013
    Location
    .
    MS-Off Ver
    .
    Posts
    4,418

    Re: Macro to change formula to value

    assuming you mean that it should apply to only the row that is changed, i.e. if you change I9 then K9 will be made into a value, not the whole column:
    Please Login or Register  to view this content.

  7. #7
    Forum Contributor
    Join Date
    02-21-2007
    MS-Off Ver
    Microsoft 365 Apps for enterprise
    Posts
    389

    Re: Macro to change formula to value

    Well in fact I need to select the range K1:K4500 as I have a formula in the row 5000 which I use to copy at the top of my page. The problem I now face is that my line is copied without the formula as it seems like the macro you provided me (which work well) is not running when I select the option but when a refresh occurs on the page.

  8. #8
    Forum Expert
    Join Date
    04-22-2013
    Location
    .
    MS-Off Ver
    .
    Posts
    4,418

    Re: Macro to change formula to value

    Hi, I'm a bit lost, in post #1 you ask for the formula in column K to be changed to a value but in post #7 you are talking about it being copied without a formula.

    Perhaps we could try and start again, can you try and explain again what it is that the code needs to do. Although, perhaps if you only want K1:K4500, then you need to change to:
    Please Login or Register  to view this content.
    but I'm not really sure.

  9. #9
    Forum Contributor
    Join Date
    02-21-2007
    MS-Off Ver
    Microsoft 365 Apps for enterprise
    Posts
    389

    Re: Macro to change formula to value

    I apologize! Let me clarify my problem with an example!

    As per the attachment, I have another macro in place that copy the rows 20:22 and paste it to 5:7 (in my macro it is set insert in fact a new row).

    If you perform the copy paste manually, as it would be with the macro, you will see that the formulas I need to keep in the cell K have gone despite that I haven't choose an option in the cell I.

    Am I clearer now??
    Attached Files Attached Files

  10. #10
    Forum Expert
    Join Date
    04-22-2013
    Location
    .
    MS-Off Ver
    .
    Posts
    4,418

    Re: Macro to change formula to value

    Please Login or Register  to view this content.
    Try that

  11. #11
    Forum Contributor
    Join Date
    02-21-2007
    MS-Off Ver
    Microsoft 365 Apps for enterprise
    Posts
    389

    Re: Macro to change formula to value

    It works much better! However, If you perform the copy twice and enter a date + select an option, then the 2 lines (5:7 & 8:10) are paste with value and I loose the formula for the second line.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Got a formula I would like to change into a macro.
    By tripey in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 10-22-2012, 10:49 AM
  2. Change formula macro
    By sirohiv in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 06-15-2011, 08:39 AM
  3. Macro to change formula
    By yogesh thakker in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 03-15-2010, 10:35 AM
  4. Macro to Change Formula
    By floridagunner in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 07-18-2007, 09:59 AM
  5. Change Formula with Macro
    By [email protected] in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 05-17-2006, 02:25 PM

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