Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default range to string


Hi all,

i need to pass a string (e.g. "D10:D150") that defines a range as
argument to a function.
My problem: I have this range defined as range object:


Code:
--------------------
Set destrange = activeSheet.Range(Cells(myDestinationStartRow, myDestinationCol), Cells(myDestinationEndRow, myDestinationCol))
--------------------


How can i convert this range to a string defined above? is this
possible?

regards, thomas


--
usadream
------------------------------------------------------------------------
usadream's Profile: http://www.excelforum.com/member.php...o&userid=32703
View this thread: http://www.excelforum.com/showthread...hreadid=530028

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4,339
Default range to string

Dim rngstr as string
rngStr=destrange.address()

"usadream" wrote:


Hi all,

i need to pass a string (e.g. "D10:D150") that defines a range as
argument to a function.
My problem: I have this range defined as range object:


Code:
--------------------
Set destrange = activeSheet.Range(Cells(myDestinationStartRow, myDestinationCol), Cells(myDestinationEndRow, myDestinationCol))
--------------------


How can i convert this range to a string defined above? is this
possible?

regards, thomas


--
usadream
------------------------------------------------------------------------
usadream's Profile: http://www.excelforum.com/member.php...o&userid=32703
View this thread: http://www.excelforum.com/showthread...hreadid=530028


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 253
Default range to string

Hi,

destrange is a range object
destrange.address = the property will return a string that is the address
It just depends on how you define your function argument ie function(rng as
string or rng as range)

Regards
Jean-Yves

"usadream" wrote in
message ...

Hi all,

i need to pass a string (e.g. "D10:D150") that defines a range as
argument to a function.
My problem: I have this range defined as range object:


Code:
--------------------
Set destrange = activeSheet.Range(Cells(myDestinationStartRow,
myDestinationCol), Cells(myDestinationEndRow, myDestinationCol))
--------------------


How can i convert this range to a string defined above? is this
possible?

regards, thomas


--
usadream
------------------------------------------------------------------------
usadream's Profile:
http://www.excelforum.com/member.php...o&userid=32703
View this thread: http://www.excelforum.com/showthread...hreadid=530028



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default range to string


thanx a lot for your replies! totally works!

now what i need is to get rid of the $ signs that show up in the
string.. any easy way to do this?

regards
thomas


--
usadream
------------------------------------------------------------------------
usadream's Profile: http://www.excelforum.com/member.php...o&userid=32703
View this thread: http://www.excelforum.com/showthread...hreadid=530028

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 253
Default range to string

Is this really a problem ?
What do you do next with your function on that range ?
JY
"usadream" wrote in
message ...

thanx a lot for your replies! totally works!

now what i need is to get rid of the $ signs that show up in the
string.. any easy way to do this?

regards
thomas


--
usadream
------------------------------------------------------------------------
usadream's Profile:
http://www.excelforum.com/member.php...o&userid=32703
View this thread: http://www.excelforum.com/showthread...hreadid=530028





  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default range to string


sorry found it, thanx :-)


--
usadream
------------------------------------------------------------------------
usadream's Profile: http://www.excelforum.com/member.php...o&userid=32703
View this thread: http://www.excelforum.com/showthread...hreadid=530028

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
Find the POSITION IN A RANGE of text in a string that matches value(s) in a range Cornell1992 Excel Programming 0 March 14th 06 07:19 PM
Retrieving range string from named range clapper Excel Programming 4 October 13th 05 03:09 PM
Translate range name passed as string to a custom function to range addresses! agarwaldvk[_25_] Excel Programming 3 September 7th 04 12:47 PM
Passing a String in Array to Range as String [email protected] Excel Programming 2 September 1st 04 01:13 AM
String to Range? Kevin G[_2_] Excel Programming 1 January 31st 04 07:08 PM


All times are GMT +1. The time now is 03:54 AM.

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"