Consulting

Results 1 to 3 of 3

Thread: Set a worksheet to be the worksheet in which a relative range currently is loated in

  1. #1

    Set a worksheet to be the worksheet in which a relative range currently is loated in

    Hi!

    I am trying to set a worksheet to be the worksheet in which a relative range currently is loated in. This relative range can be located in any of many worksheets

    [vba]
    Dim KPwb As Workbook
    Dim RELws As Worksheet

    Set KPwb = ActiveWorkbook
    Set RELws = whatever worksheet Range("RelativeRange") is located in

    ' RelativeRange= a named area which address is dependant on a function and can be located in any of many worksheets
    [/vba]

    Ideas?
    Last edited by Rejje; 05-27-2011 at 04:14 AM.

  2. #2
    Distinguished Lord of VBAX VBAX Grand Master Bob Phillips's Avatar
    Joined
    Apr 2005
    Posts
    25,453
    Location
    [vba]

    Dim KPwb As Workbook
    Dim RELws As Worksheet

    Set KPwb = ActiveWorkbook
    Application.Goto Range("RelativeRange")
    Set RELws = ActiveSheet
    [/vba]
    ____________________________________________
    Nihil simul inventum est et perfectum

    Abusus non tollit usum

    Last night I dreamed of a small consolation enjoyed only by the blind: Nobody knows the trouble I've not seen!
    James Thurber

  3. #3
    Mac Moderator VBAX Guru mikerickson's Avatar
    Joined
    May 2007
    Location
    Davis CA
    Posts
    2,778
    Perhaps
    [VBA]Set RELws = Range("RelativeRange").Parent[/VBA]

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •