+ Reply to Thread
Results 1 to 4 of 4

Replace Formulas with Values

  1. #1
    mazo
    Guest

    Replace Formulas with Values

    Hi

    I have a formula in a certain cell and then use the AutoFill-fuction

    Range("C6").FormulaR1C1 = "=R[-2]C+R1C6"
    Range("C6").Select
    Selection.AutoFill Destination:=Range("C6:C900"),
    Type:=xlFillDefault

    Later I want to use the Values of Range("C6:C900")

    How can I get the values?
    Or:
    Can I use the AutoFillfunction also for Range("C6").Value = ?? ?


    Mazo


  2. #2
    Gary''s Student
    Guest

    RE: Replace Formulas with Values

    try:

    MSGBOX(RANGE("C6").Value) to display the value of a single cell in that
    range. Vary the address according to your needs.
    --
    Gary's Student


    "mazo" wrote:

    > Hi
    >
    > I have a formula in a certain cell and then use the AutoFill-fuction
    >
    > Range("C6").FormulaR1C1 = "=R[-2]C+R1C6"
    > Range("C6").Select
    > Selection.AutoFill Destination:=Range("C6:C900"),
    > Type:=xlFillDefault
    >
    > Later I want to use the Values of Range("C6:C900")
    >
    > How can I get the values?
    > Or:
    > Can I use the AutoFillfunction also for Range("C6").Value = ?? ?
    >
    >
    > Mazo
    >
    >


  3. #3
    Valued Forum Contributor
    Join Date
    04-11-2006
    Posts
    407
    This should return every value for all the rows, if that's what you need.

    Sub TestMacro()
    Range("C6").FormulaR1C1 = "=R[-2]C+R1C6"
    Range("C6").Select
    Selection.AutoFill Destination:=Range("C6:C900"), Type:=xlFillDefault

    Dim iMyCount As Integer
    iMyCount = 0
    Do
    Debug.Print ActiveCell.Offset(iMyCount, 0).Value
    iMyCount = iMyCount + 1
    Loop Until iMyCount = 895
    End Sub
    Hi

    I have a formula in a certain cell and then use the AutoFill-fuction

    Range("C6").FormulaR1C1 = "=R[-2]C+R1C6"
    Range("C6").Select
    Selection.AutoFill Destination:=Range("C6:C900"),
    Type:=xlFillDefault

    Later I want to use the Values of Range("C6:C900")

    How can I get the values?
    Or:
    Can I use the AutoFillfunction also for Range("C6").Value = ?? ?


    Mazo

  4. #4
    GS
    Guest

    RE: Replace Formulas with Values

    Hi Mazo,

    You could try this:

    With Range("C6:C900")
    .FormulaR1C1 = "=R[-2]C+R1C6"
    .Value = .Value
    End With

    Regards,
    Garry

+ 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