+ Reply to Thread
Results 1 to 3 of 3

Setting A Range

  1. #1
    moon
    Guest

    Re: Setting A Range


    Just pass the range as an argument in your sub...

    Public Sub RangeDemo(r As Range)
    Dim e As Variant 'every element in range
    For Each e In r
    MsgBox r.Value
    Next
    End Sub




    "Reggie" <[email protected]> schreef in bericht
    news:[email protected]...
    > Is is possible to to set a range in VB and have any sub use it? If so how
    > would i be able to do this? Code so far
    >
    > Set plane = Worksheets("Sheet1").Range("A98")
    >
    > i want the range "plane" to be used throughout the worksheet.




  2. #2
    Reggie
    Guest

    Setting A Range

    Is is possible to to set a range in VB and have any sub use it? If so how
    would i be able to do this? Code so far

    Set plane = Worksheets("Sheet1").Range("A98")

    i want the range "plane" to be used throughout the worksheet.

  3. #3
    moon
    Guest

    Re: Setting A Range


    Just pass the range as an argument in your sub...

    Public Sub RangeDemo(r As Range)
    Dim e As Variant 'every element in range
    For Each e In r
    MsgBox r.Value
    Next
    End Sub




    "Reggie" <[email protected]> schreef in bericht
    news:[email protected]...
    > Is is possible to to set a range in VB and have any sub use it? If so how
    > would i be able to do this? Code so far
    >
    > Set plane = Worksheets("Sheet1").Range("A98")
    >
    > i want the range "plane" to be used throughout the worksheet.




+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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