ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Find a backslash at end of a cell (https://www.excelbanter.com/excel-programming/320106-find-backslash-end-cell.html)

Pirke

Find a backslash at end of a cell
 
Hi all,

maybe someone can help me
I want to look trough a large excel file, and replace
every backslash that's the last character in a cell.
All other backslashes should not be replaced!

I'm trying to write a macro for this, but I don't know how
to make sure it's replaced only when it's the last
charcter in a cell.


How can I do this?

I'm working with Excel XP.


thanks, Pirke



Bob Phillips[_6_]

Find a backslash at end of a cell
 

For Each Cell In ActiveSheet.UsedRange
If Right(cell.Value,1) = "\" Then
cell.Value = left(cell.Value,Len(cell.Value)-1)
End If
Next Cell



--

HTH

RP
(remove nothere from the email address if mailing direct)


"Pirke" wrote in message
...
Hi all,

maybe someone can help me
I want to look trough a large excel file, and replace
every backslash that's the last character in a cell.
All other backslashes should not be replaced!

I'm trying to write a macro for this, but I don't know how
to make sure it's replaced only when it's the last
charcter in a cell.


How can I do this?

I'm working with Excel XP.


thanks, Pirke





Pirke

Find a backslash at end of a cell
 
Bob,

exactly what I was looking for
so thanks a lot!!


Pirke

-----Original Message-----

For Each Cell In ActiveSheet.UsedRange
If Right(cell.Value,1) = "\" Then
cell.Value = left(cell.Value,Len(cell.Value)-

1)
End If
Next Cell



--

HTH

RP
(remove nothere from the email address if mailing direct)


"Pirke" wrote in

message
...
Hi all,

maybe someone can help me
I want to look trough a large excel file, and replace
every backslash that's the last character in a cell.
All other backslashes should not be replaced!

I'm trying to write a macro for this, but I don't know

how
to make sure it's replaced only when it's the last
charcter in a cell.


How can I do this?

I'm working with Excel XP.


thanks, Pirke




.



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

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