+ Reply to Thread
Results 1 to 3 of 3

Target As Excel.Range or Target As Range

  1. #1
    Forum Contributor
    Join Date
    02-26-2005
    Posts
    175

    Target As Excel.Range or Target As Range

    Hi,
    Is there any difference in these two statements??
    What does the word "Excel." do??

    Private Sub Worksheet_Change(ByVal Target As Excel.Range)
    Private Sub Worksheet_Change(ByVal Target As Range)

    Thx
    Dave

  2. #2
    Jim Thomlinson
    Guest

    RE: Target As Excel.Range or Target As Range

    99.9% of the time there will be absolutely no difference. Using the word
    Excel more fully resolves the object. Range in this case is a part of the
    Excel object. If you had referenced something else which had Range as a key
    word then you would need this to specify what type of range you were refering
    to.
    --
    HTH...

    Jim Thomlinson


    "Piranha" wrote:

    >
    > Hi,
    > Is there any difference in these two statements??
    > What does the word "Excel." do??
    >
    > Private Sub Worksheet_Change(ByVal Target As Excel.Range)
    > Private Sub Worksheet_Change(ByVal Target As Range)
    >
    > Thx
    > Dave
    >
    >
    > --
    > Piranha
    > ------------------------------------------------------------------------
    > Piranha's Profile: http://www.excelforum.com/member.php...o&userid=20435
    > View this thread: http://www.excelforum.com/showthread...hreadid=376118
    >
    >


  3. #3
    Forum Contributor
    Join Date
    02-26-2005
    Posts
    175
    Jim,
    Thank you very much for your explanation. It is very good.
    Thx again
    Dave

    Quote Originally Posted by Jim Thomlinson
    99.9% of the time there will be absolutely no difference. Using the word
    Excel more fully resolves the object. Range in this case is a part of the
    Excel object. If you had referenced something else which had Range as a key
    word then you would need this to specify what type of range you were refering
    to.
    --
    HTH...

    Jim Thomlinson


    "Piranha" wrote:

    >
    > Hi,
    > Is there any difference in these two statements??
    > What does the word "Excel." do??
    >
    > Private Sub Worksheet_Change(ByVal Target As Excel.Range)
    > Private Sub Worksheet_Change(ByVal Target As Range)
    >
    > Thx
    > Dave
    >
    >
    > --
    > Piranha
    > ------------------------------------------------------------------------
    > Piranha's Profile: http://www.excelforum.com/member.php...o&userid=20435
    > View this thread: http://www.excelforum.com/showthread...hreadid=376118
    >
    >

+ 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