#1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 189
Default address in VBA

hi,
is there any difference between these two expressions:?
target.address=range("D1").address
and
target.address(false,false)=range("D1").address
thanx
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 35,218
Default address in VBA

Yes.

If you're using:

if target.address(false,false) = range("D1").address then
msgbox "true"
else
msgbox "False"
end if

You'll never see the True msgbox.

Try this in a test macro:

with range("D1")
msgbox .address & vblf & .address(false,false)
end with

And you'll see the difference.

peyman wrote:

hi,
is there any difference between these two expressions:?
target.address=range("D1").address
and
target.address(false,false)=range("D1").address
thanx


--

Dave Peterson
  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 4,624
Default address in VBA

Yes. The second formula will always return False, since .address will by
default return an absolute address.

This is equivalent:

target.Address(False, False) = Range("D1").Address(False, False)


but of course, since you know the cell reference you could just as
easily use

target.Address(False, False) = "D1"



In article ,
peyman wrote:

hi,
is there any difference between these two expressions:?
target.address=range("D1").address
and
target.address(false,false)=range("D1").address
thanx

  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 189
Default address in VBA

tahnx Dave.

"Dave Peterson" wrote:

Yes.

If you're using:

if target.address(false,false) = range("D1").address then
msgbox "true"
else
msgbox "False"
end if

You'll never see the True msgbox.

Try this in a test macro:

with range("D1")
msgbox .address & vblf & .address(false,false)
end with

And you'll see the difference.

peyman wrote:

hi,
is there any difference between these two expressions:?
target.address=range("D1").address
and
target.address(false,false)=range("D1").address
thanx


--

Dave Peterson

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
How do I avoid excel change absolute address to relative address Miguel Excel Discussion (Misc queries) 3 May 10th 07 11:18 PM
what is difference between absolute address and relative address? what is difference between absolute addr Excel Discussion (Misc queries) 1 July 22nd 06 08:17 AM
long address list, name-address-city, listed vertically, how do y. kb Excel Discussion (Misc queries) 2 March 4th 05 12:48 AM
How do I import Office address book to Outlook Express address bo. snnorp Excel Discussion (Misc queries) 2 February 22nd 05 11:47 AM
Using =address to provide address location for =average ahills Excel Worksheet Functions 2 November 30th 04 03:10 AM


All times are GMT +1. The time now is 04:13 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"