+ Reply to Thread
Results 1 to 4 of 4

Use a variable in Range.Formula

  1. #1
    Valued Forum Contributor
    Join Date
    12-02-2012
    Location
    Melbourne, VIC
    MS-Off Ver
    Excel 2016
    Posts
    750

    Use a variable in Range.Formula

    How to use the current value of a variable in Range.Formula?
    I need a macro to reset a sheet; wherein amongst other things, I need to insert a formula in every alternate cell (say from B2 to B10) that checks a condition based on the adjacent cell in Column A.
    I tried the following code, but it inserts the text "iRow" instead of it's value.

    Please Login or Register  to view this content.
    Warm regards,
    Jewel

  2. #2
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    25,423

    Re: Use a variable in Range.Formula

    Try it like this:

    Please Login or Register  to view this content.
    Hope this helps.

    Pete

  3. #3
    Forum Guru Izandol's Avatar
    Join Date
    03-29-2012
    Location
    *
    MS-Off Ver
    Excel 20(03|10|13)
    Posts
    2,581

    Re: Use a variable in Range.Formula

    You may also use:
    Please Login or Register  to view this content.
    • Please remember to mark threads Solved with Thread Tools link at top of page.
    • Please use code tags when posting code: [code]Place your code here[/code]
    • Please read Forum Rules

  4. #4
    Valued Forum Contributor
    Join Date
    12-02-2012
    Location
    Melbourne, VIC
    MS-Off Ver
    Excel 2016
    Posts
    750

    Re: Use a variable in Range.Formula

    Pete_UK, Izandol,
    Many thanks for your prompt support.

    Warm regards,
    Jewel

+ 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. [SOLVED] Formula Array with a variable range
    By KParkerTX in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 10-01-2013, 04:25 PM
  2. [SOLVED] Use variable range in a formula
    By Mumps1 in forum Excel Formulas & Functions
    Replies: 17
    Last Post: 05-20-2013, 07:18 PM
  3. Formula to sum a variable column range
    By TIERNAN in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 10-17-2012, 02:23 PM
  4. [SOLVED] Passing a variable range to a formula
    By jacob@thepenpoint in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 10-10-2012, 06:44 PM
  5. Range and Variable formula
    By tlm in forum Excel General
    Replies: 3
    Last Post: 02-10-2010, 03:20 PM

Tags for this Thread

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