ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   range to string (https://www.excelbanter.com/excel-programming/358086-range-string.html)

usadream[_9_]

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


Toppers

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



Jean-Yves[_2_]

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




usadream[_10_]

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


Jean-Yves[_2_]

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




usadream[_11_]

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



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

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com