+ Reply to Thread
Results 1 to 2 of 2

Alternative to if then statement to open different worksheets

  1. #1
    Registered User
    Join Date
    06-05-2018
    Location
    USA
    MS-Off Ver
    2016
    Posts
    13

    Alternative to if then statement to open different worksheets

    I have four variables as follows: theta_1, theta_2, alpha_1, and alpha_2. Based on these variables (which are already calculated), I need to pull data from the four worksheets that corresponds. Each sheet is named for t[insert number]a[insert number], since theta and alpha both contribute to the output.

    This is tough to describe, so I think it may be best to give an example:
    Let say theta_1 = 30, theta_2 = 35, alpha_1 = 10, and alpha_2 = 15.
    I would need to retrieve the following four worksheets: t30a10, t30a15, t35a10, and t35a15.

    In VBA, is there a way to (for lack of a better word) "select" these worksheets without having to do a very long if/then statement for each case? I don't need to "select" the worksheets, I just need the code to know that it needs to be referring to only those four sheets (out of roughly 100 sheets total).

    Thanks.

  2. #2
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: Alternative to if then statement to open different worksheets

    Please Login or Register  to view this content.
    Entia non sunt multiplicanda sine necessitate

+ 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] IF Statement Alternative
    By keith740 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 12-16-2016, 11:11 PM
  2. [SOLVED] Alternative to IF statement?
    By adamdaniel143 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 11-23-2013, 10:01 PM
  3. [SOLVED] Alternative to Massive If Statement
    By jonboy6257 in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 10-31-2013, 03:07 PM
  4. Excel 2007 : Alternative to if statement ?
    By tommo49 in forum Excel General
    Replies: 4
    Last Post: 11-10-2009, 10:26 AM
  5. Alternative to the FileCopy Statement for open files?
    By broro183 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 12-10-2008, 06:07 AM
  6. Alternative to a if statement
    By lynettel in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 10-07-2008, 02:15 PM
  7. alternative to if statement
    By Dan in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 08-15-2006, 03:25 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