+ Reply to Thread
Results 1 to 3 of 3

How to define a range in another worksheet ?

Hybrid View

SelAli How to define a range in... 04-11-2014, 06:16 PM
stnkynts Re: How to define a range in... 04-11-2014, 06:30 PM
SelAli Re: How to define a range in... 04-11-2014, 06:35 PM
  1. #1
    Registered User
    Join Date
    04-11-2014
    Location
    France
    MS-Off Ver
    Excel 2010
    Posts
    2

    How to define a range in another worksheet ?

    Hello everybody !
    First at all, please apologize my english.

    I have a file with up to 40 worksheets, and I want to find a way to define a range in a WorkSheet using a string as the name of the worksheet.

    Do you know how to do it guys ?

  2. #2
    Forum Expert
    Join Date
    07-31-2010
    Location
    California
    MS-Off Ver
    Excel 2007
    Posts
    4,070

    Re: How to define a range in another worksheet ?

    Do you mean this:

    Sub Example()
    Dim myRange As Range
    Dim myString As String
    
    myString = "Summary"
    
    Set myRange = Sheets(myString).Range("A1:A10") 'arbitrary range
    
    End Sub

  3. #3
    Registered User
    Join Date
    04-11-2014
    Location
    France
    MS-Off Ver
    Excel 2010
    Posts
    2

    Re: How to define a range in another worksheet ?

    Thank you a lot, it works. Do you know if I can use myRange in a Vlookup function ?
    Sal = Application.WorksheetFunction.VLookup(startingdate, myRange, 3, False)

+ 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] Define new range names based on existing range name offset 1 column to right
    By jprlimey in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-03-2014, 07:53 PM
  2. excel macro range define to another sheet / named range
    By koi in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 01-21-2013, 10:25 AM
  3. Define range to select from current cell in a full range (using worksheet_change)
    By draddy in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 01-07-2013, 11:48 AM
  4. [SOLVED] Using cell value to define a range (for a variable defined as a range)
    By Sccye in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 04-02-2012, 10:25 AM
  5. Define named range where user can define size
    By nahousto in forum Excel General
    Replies: 4
    Last Post: 07-06-2009, 05:09 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