Results 1 to 2 of 2
  1. #1
    Join Date
    Feb 2004
    Posts
    1

    Unanswered: code to change formula in cells doesn't work

    I am trying to write a script so that when a user clicks on a radio button the formula in a cell changes.

    my code is
    Range("d10").Select
    ActiveCell.FormulaR1C1 = "=(B10/C10)+(30/60)"

    but when I click on the button the formula entered is
    =('B10'/$K:$K)+(45/60)

    why and how do i fix it??

    Thanks

  2. #2
    Join Date
    Jan 2004
    Location
    Aberdeen, Scotland
    Posts
    1,067

    Re: code to change formula in cells doesn't work

    Originally posted by bohica
    I am trying to write a script so that when a user clicks on a radio button the formula in a cell changes.

    my code is
    Range("d10").Select
    ActiveCell.FormulaR1C1 = "=(B10/C10)+(30/60)"

    but when I click on the button the formula entered is
    =('B10'/$K:$K)+(45/60)

    why and how do i fix it??

    Thanks
    Hi

    only a small change needs to be made here instead of using
    ActiveCell.FormulaR1C1 = etc.
    use
    ActiveCell.Formula = etc.
    the C reference in your formula is getting interpreted as a column i.e. K

    I hope this sorts your problem for you

    David

Posting Permissions

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