+ Reply to Thread
Results 1 to 5 of 5

copy formula from one cell to another

  1. #1
    Forum Contributor
    Join Date
    06-04-2006
    Posts
    132

    copy formula from one cell to another

    Hi,

    I have a question in regards to copying the formula from one cell to another cells in excel 03.

    For example,

    cell "C3" has a formula namely if(a2 = "OK", a2, "false")

    I would like C4 all the way to C10 to have the same formula. Rather than putting in the formula into the cell by using (ActiveCell.FormulaR1C1), i was thinking if there is away of copying the formula as it goes. So i tried the code below and got error with message "autofilled failed"

    Please Login or Register  to view this content.
    What i would like it to do is as it inserts new rows, it also copies the formula from the previous one and pastes to the cell of the new rows.

    Thank you in advance

  2. #2
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,524
    try
    Please Login or Register  to view this content.

  3. #3
    Forum Contributor
    Join Date
    06-04-2006
    Posts
    132
    Thank you Jindon for your reply.

    No, it deleted all the rows instead.

    I must've done something wrong here but am struggling to find out the cause.

    By the way, let me just re-phrase what i just said.

    I quote
    "For example,

    cell "C3" has a formula namely if(a2 = "OK", a2, "false")

    I would like C4 all the way to C10 to have the same formula."

    I said it wrong. What i meant was C3 has the formula namely if(a3 = "OK", a3, "false")

    So, if the new row, C4, then the formula would be if(a4 = "OK", a4, "false"). The same thing goes for C5, C6, ... to C10

    Not sure if the code you gave would work in this scenario.

    My apology.

    Thank you in advance

  4. #4
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,524
    Deleted ?
    Please Login or Register  to view this content.

  5. #5
    Forum Contributor
    Join Date
    06-04-2006
    Posts
    132
    Thank you Jindon for your reply.

    My apology. It works. Your code works all this time. It's just me that i must've been half asleep when trying out your code. Hence, other function that does the deletion got executed instead. Sorry about this.

    Thank you once again

+ 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