ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Search and find all "$" in a string (https://www.excelbanter.com/excel-programming/419753-search-find-all-%24-string.html)

DontKnow

Search and find all "$" in a string
 
Hi Guys,

I need help to search and find all the "$" in a range so as the outpuit
looks like this

"A10:AG10"

At the moment the unwanted string looks like this

"$A$10:$AG$10"

Is their a way that I can be rid of the $ from my string range.

I have tried instr command and then deleting the found value etc but it is
rather cumbersome.

Can someone help me??

Many thnaks for your input in advance!!

Cheers,

joel

Search and find all "$" in a string
 
Use Replace

MyString = Replace(MyString,"$","")

"DontKnow" wrote:

Hi Guys,

I need help to search and find all the "$" in a range so as the outpuit
looks like this

"A10:AG10"

At the moment the unwanted string looks like this

"$A$10:$AG$10"

Is their a way that I can be rid of the $ from my string range.

I have tried instr command and then deleting the found value etc but it is
rather cumbersome.

Can someone help me??

Many thnaks for your input in advance!!

Cheers,


Rick Rothstein

Search and find all "$" in a string
 
Where did you get that text from? If it was from the Address property of a
Range, you could have that property give it to you in the form you want by
making use of its optional arguments. For example, execute this line in the
Immediate Window...

MsgBox Range("B2:H3").Address & vbCrLf & _
Range("B2:H3").Address(False, False)

Notice the $ signs in the first line and, for the same range, the lack of
them in the second line.

--
Rick (MVP - Excel)


"DontKnow" wrote in message
...
Hi Guys,

I need help to search and find all the "$" in a range so as the outpuit
looks like this

"A10:AG10"

At the moment the unwanted string looks like this

"$A$10:$AG$10"

Is their a way that I can be rid of the $ from my string range.

I have tried instr command and then deleting the found value etc but it is
rather cumbersome.

Can someone help me??

Many thnaks for your input in advance!!

Cheers,



DontKnow

Search and find all "$" in a string
 
Thanks Guys

Thats excellent!!

Cheers

"Rick Rothstein" wrote:

Where did you get that text from? If it was from the Address property of a
Range, you could have that property give it to you in the form you want by
making use of its optional arguments. For example, execute this line in the
Immediate Window...

MsgBox Range("B2:H3").Address & vbCrLf & _
Range("B2:H3").Address(False, False)

Notice the $ signs in the first line and, for the same range, the lack of
them in the second line.

--
Rick (MVP - Excel)


"DontKnow" wrote in message
...
Hi Guys,

I need help to search and find all the "$" in a range so as the outpuit
looks like this

"A10:AG10"

At the moment the unwanted string looks like this

"$A$10:$AG$10"

Is their a way that I can be rid of the $ from my string range.

I have tried instr command and then deleting the found value etc but it is
rather cumbersome.

Can someone help me??

Many thnaks for your input in advance!!

Cheers,





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

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