+ Reply to Thread
Results 1 to 5 of 5

Formula using reference to variable worksheet

  1. #1
    Registered User
    Join Date
    12-27-2019
    Location
    Denmark
    MS-Off Ver
    Microsoft Excel 2013 (15.0.5.5197.1000)
    Posts
    2

    Formula using reference to variable worksheet

    Hello folks

    My problem boils down to the code given. I want to assign a name to a worksheet and then use that name in a formula. I have tried some things, and im having trouble with the syntax.

    Please Login or Register  to view this content.
    The code is not happy about the Range("M18") reference which breaks my brain. Any suggestions are welcome.
    Also, im new here, so hey whats up.
    Last edited by Pepe Le Mokko; 12-27-2019 at 10:33 AM. Reason: Added code tags

  2. #2
    Forum Expert Bob Phillips's Avatar
    Join Date
    09-03-2005
    Location
    Wessex
    MS-Off Ver
    Office 2003, 2010, 2013, 2016, 365
    Posts
    3,284

    Re: Formula using reference to variable worksheet

    Try this

    Please Login or Register  to view this content.

  3. #3
    Forum Expert Pepe Le Mokko's Avatar
    Join Date
    05-14-2009
    Location
    Belgium
    MS-Off Ver
    O365 v 2402
    Posts
    13,444

    Re: Formula using reference to variable worksheet

    Administrative Note:

    Welcome to the forum.

    We would very much like to help you with your query, however you need to include code tags around your code.

    Please take a moment to add the tags. Posting code between tags makes your code much easier to read and copy for testing, and it also maintains VBA formatting.

    Please see Forum Rule #2 about code tags and adjust accordingly. Click on Edit to open your post, then highlight your code and click the # icon at the top of your post window. More information about these and other tags can be found here

    I did it for you this time. Please read forum rules. Thanks

  4. #4
    Registered User
    Join Date
    12-27-2019
    Location
    Denmark
    MS-Off Ver
    Microsoft Excel 2013 (15.0.5.5197.1000)
    Posts
    2

    Re: Formula using reference to variable worksheet

    That worked after fiddling with it, thanks!

  5. #5
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,244

    Re: Formula using reference to variable worksheet

    If that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED.
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    Forum Rules (updated August 2023): please read them here.

+ 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. Macro with variable reference to the worksheet tab
    By tuph in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 03-16-2014, 10:23 PM
  2. how do i reference a worksheet variable in a formula?
    By chemeng1T3 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 07-06-2012, 08:27 AM
  3. Using a variable inside a worksheet reference in a formula
    By Guinness85 in forum Excel General
    Replies: 1
    Last Post: 07-25-2011, 06:44 PM
  4. Replies: 2
    Last Post: 10-06-2009, 04:32 AM
  5. [SOLVED] Reference Worksheet Name variable in VBA formula
    By Mike in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-08-2006, 03:05 PM
  6. Vlookup with variable worksheet reference
    By trempnvt in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 05-23-2006, 01:50 PM
  7. how to reference a worksheet with a variable vs a name
    By ibbm in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 04-17-2006, 03:00 PM
  8. Making a file and worksheet reference into a variable....
    By Mr Mike in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 07-06-2005, 04: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