+ Reply to Thread
Results 1 to 4 of 4

Formula using stored variable

  1. #1
    Registered User
    Join Date
    02-09-2015
    Location
    England
    MS-Off Ver
    2013
    Posts
    9

    Formula using stored variable

    Hi

    I'm trying to code a macro to enter a formula into multiple cells. The thing is, part of the range of the formula has been stored in a variable as the column its going to reference is going to change:

    Range("C5").Formula = "=COUNTIFS(Table!$I:$I, $E$2,Table!SkillLetter01:SkillLetter01, Reports!B5)"

    I need to replace SkillLetter01 with the value stored in SkillLetter but cannot for the life of me work out how. Any help would be appreciated!

  2. #2
    Forum Expert judgeh59's Avatar
    Join Date
    02-07-2013
    Location
    Boise, Idaho
    MS-Off Ver
    Excel 2016
    Posts
    2,310

    Re: Formula using stored variable

    something like

    Please Login or Register  to view this content.
    I think I have all the right double quotes and &'s
    Ernest

    Please consider adding a * if I helped

    Nothing drives me crazy - I'm always close enough to walk....

  3. #3
    Registered User
    Join Date
    02-09-2015
    Location
    England
    MS-Off Ver
    2013
    Posts
    9

    Re: Formula using stored variable

    Perfect! Thanks. Knew there would be a simple solution :D

  4. #4
    Forum Expert judgeh59's Avatar
    Join Date
    02-07-2013
    Location
    Boise, Idaho
    MS-Off Ver
    Excel 2016
    Posts
    2,310

    Re: Formula using stored variable

    sometimes it's hard to get your head wrapped around all the double quotes and &'s....glad I could help...

    Thanks for setting the thread to Solved...If you feel I deserve an increase in my reputation, feel free to click on the star in the lower left of the thread. Remember, someday when you help somebody they may add to your rep points, and it could be me...just a thought...

+ 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. Correct syntax to add a workbook name that is stored in a variable into a formula
    By lordterrin in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 02-25-2014, 03:46 PM
  2. vba code: value of a variable which is stored in a variable ( equal to Pointers in "C")
    By vidyuthrajesh in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 06-18-2012, 04:24 PM
  3. Help with a Formula to Print a stored variable
    By Modify_inc in forum Excel General
    Replies: 4
    Last Post: 12-16-2010, 09:59 AM
  4. Inserting Stored Variable Values
    By rziegler in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 09-05-2008, 05:57 PM
  5. Run macro from name stored in variable?
    By chubster264 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 01-05-2006, 05:55 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