+ Reply to Thread
Results 1 to 4 of 4

Customize ActiveCell.FormulaR1C1

  1. #1
    Forum Contributor
    Join Date
    07-29-2013
    Location
    Australia
    MS-Off Ver
    Excel 2007
    Posts
    110

    Customize ActiveCell.FormulaR1C1

    Hi all!

    See attached for sample file: Insert Row Number to Formula.xlsm

    Issue:

    Formula List sheet - shows Row # of agent in Sheet1
    How do I write a formula where formula will consider the Row# of the agent specified in "Formula List" sheet?

    Example: This is the formula for AGENT: ANDY

    Please Login or Register  to view this content.
    I want the same formula for AGENT: MARIE but Marie is in Row 4
    How do I change
    Please Login or Register  to view this content.
    to reflect AGENT: MARIE's Row location per "Formula List" sheet?

    Thank you in advance!

  2. #2
    Forum Expert millz's Avatar
    Join Date
    08-14-2013
    Location
    Singapore
    MS-Off Ver
    Excel, Access 2016
    Posts
    1,694

    Re: Customize ActiveCell.FormulaR1C1

    Your original macro for ANDY is inserted into cell D3, and the formula is already referencing that particular row, but with column-offset referencing style.

    To change it for MARIE, just simply change
    Range("D3").Select to Range("D4").Select
    Range("O3").Select to Range("O4").Select
    Selection.AutoFill Destination:=Range("D3:N3"), Type:=xlFillDefault to Selection.AutoFill Destination:=Range("D4:N4"), Type:=xlFillDefault.
    Though it may not be the best way to do it.

    You can also just insert the formulas directly for the entire range of cells:
    Please Login or Register  to view this content.

  3. #3
    Forum Contributor
    Join Date
    07-29-2013
    Location
    Australia
    MS-Off Ver
    Excel 2007
    Posts
    110

    Re: Customize ActiveCell.FormulaR1C1

    Quote Originally Posted by millz View Post
    Your original macro for ANDY is inserted into cell D3, and the formula is already referencing that particular row, but with column-offset referencing style.

    To change it for MARIE, just simply change
    Range("D3").Select to Range("D4").Select
    Range("O3").Select to Range("O4").Select
    Selection.AutoFill Destination:=Range("D3:N3"), Type:=xlFillDefault to Selection.AutoFill Destination:=Range("D4:N4"), Type:=xlFillDefault.
    Though it may not be the best way to do it.

    You can also just insert the formulas directly for the entire range of cells:
    Please Login or Register  to view this content.
    I want the VBA to do the range change automatically if I could

  4. #4
    Forum Expert millz's Avatar
    Join Date
    08-14-2013
    Location
    Singapore
    MS-Off Ver
    Excel, Access 2016
    Posts
    1,694

    Re: Customize ActiveCell.FormulaR1C1

    Quote Originally Posted by smartbuyer View Post
    I want the VBA to do the range change automatically if I could
    I don't understand what you mean, you need to explain in more detail what you want to do.

    "Range change" from what to what?

+ 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. ActiveCell.FormulaR1C1 get next column in loop
    By dwr0211 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 06-13-2012, 09:29 PM
  2. Concatenating literal, with ActiveCell and FormulaR1C1
    By LydiasDad in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 06-29-2011, 06:40 PM
  3. ActiveCell.FormulaR1C1 Dynamic Row
    By goldenbear10 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 12-07-2009, 04:47 AM
  4. [SOLVED] SumIf in ActiveCell.FormulaR1C1 ?
    By RitaP in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 07-20-2006, 02:20 PM
  5. ActiveCell.FormulaR1C1 Sum Function
    By mb in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 10-29-2005, 07:05 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