Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel,microsoft.public.excel.programming
J_J J_J is offline
external usenet poster
 
Posts: 58
Default can I replace all with a macro?

Hi,
Can I replace (all "i" characters with "ý") and (all "g" characters with
"ð") and (all "u" characters with "ü") within all cells of all Excel sheets
in a workbook with a VB macro?
TIA



  #2   Report Post  
Posted to microsoft.public.excel,microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default can I replace all with a macro?

Record a macro in Excel that does it, and you will then know you can.

--

HTH

RP

"J_J" wrote in message
...
Hi,
Can I replace (all "i" characters with "ý") and (all "g" characters with
"ð") and (all "u" characters with "ü") within all cells of all Excel

sheets
in a workbook with a VB macro?
TIA





  #3   Report Post  
Posted to microsoft.public.excel,microsoft.public.excel.programming
J_J J_J is offline
external usenet poster
 
Posts: 58
Default can I replace all with a macro?

Hi Bob,
Thanks for your suggestion. Yes the below code "partly" does the job
'--------------------------------
Sub Macro1()
' Macro1 Macro
' Macro recorded 20.10.2004 by J_J
Cells.Replace What:="i", Replacement:="ý", LookAt:=xlPart, SearchOrder _
:=xlByRows, MatchCase:=False
Cells.Replace What:="g", Replacement:="ð", LookAt:=xlPart, SearchOrder _
:=xlByRows, MatchCase:=False
Cells.Replace What:="u", Replacement:="ü", LookAt:=xlPart, SearchOrder _
:=xlByRows, MatchCase:=False
End Sub
'--------------------------------
but I need to do it far "all" existing Sheets in the workbook all in one
go...
Thanks
J_J

"Bob Phillips" wrote in message
...
Record a macro in Excel that does it, and you will then know you can.

--

HTH

RP

"J_J" wrote in message
...
Hi,
Can I replace (all "i" characters with "ý") and (all "g" characters with
"ð") and (all "u" characters with "ü") within all cells of all Excel

sheets
in a workbook with a VB macro?
TIA







  #4   Report Post  
Posted to microsoft.public.excel,microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default can I replace all with a macro?

J_J,

This is untested, but fingers-crossed

Sub Macro1()
Dim sh As Worksheet
For Each sh In Activeworkbook.Worksheets
ReplaceAll sh, "i","y"
ReplaceAll sh, "g", "ð"
ReplaceAll sh, "u", "ü"
Next sh
End Sub

Private Sub ReplaceAll(sh As Worksheet, pWhat As String, pBy As String)
sh.Cells.Replace What:="i", _
Replacement:="ý", _
LookAt:=xlPart, _
SearchOrder:=xlByRows, _
MatchCase:=False

End Sub

--

HTH

RP

"J_J" wrote in message
...
Hi Bob,
Thanks for your suggestion. Yes the below code "partly" does the job
'--------------------------------
Sub Macro1()
' Macro1 Macro
' Macro recorded 20.10.2004 by J_J
Cells.Replace What:="i", Replacement:="ý", LookAt:=xlPart, SearchOrder

_
:=xlByRows, MatchCase:=False
Cells.Replace What:="g", Replacement:="ð", LookAt:=xlPart, SearchOrder

_
:=xlByRows, MatchCase:=False
Cells.Replace What:="u", Replacement:="ü", LookAt:=xlPart, SearchOrder

_
:=xlByRows, MatchCase:=False
End Sub
'--------------------------------
but I need to do it far "all" existing Sheets in the workbook all in one
go...
Thanks
J_J

"Bob Phillips" wrote in message
...
Record a macro in Excel that does it, and you will then know you can.

--

HTH

RP

"J_J" wrote in message
...
Hi,
Can I replace (all "i" characters with "ý") and (all "g" characters

with
"ð") and (all "u" characters with "ü") within all cells of all Excel

sheets
in a workbook with a VB macro?
TIA









  #5   Report Post  
Posted to microsoft.public.excel,microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default can I replace all with a macro?

oops

Private Sub ReplaceAll(sh As Worksheet, pWhat As String, pBy As String)
sh.Cells.Replace What:=pWhat, _
Replacement:=pBy, _
LookAt:=xlPart, _
SearchOrder:=xlByRows, _
MatchCase:=False

End Sub


--

HTH

RP

"Bob Phillips" wrote in message
...
J_J,

This is untested, but fingers-crossed

Sub Macro1()
Dim sh As Worksheet
For Each sh In Activeworkbook.Worksheets
ReplaceAll sh, "i","y"
ReplaceAll sh, "g", "ð"
ReplaceAll sh, "u", "ü"
Next sh
End Sub

Private Sub ReplaceAll(sh As Worksheet, pWhat As String, pBy As String)
sh.Cells.Replace What:="i", _
Replacement:="ý", _
LookAt:=xlPart, _
SearchOrder:=xlByRows, _
MatchCase:=False

End Sub

--

HTH

RP

"J_J" wrote in message
...
Hi Bob,
Thanks for your suggestion. Yes the below code "partly" does the job
'--------------------------------
Sub Macro1()
' Macro1 Macro
' Macro recorded 20.10.2004 by J_J
Cells.Replace What:="i", Replacement:="ý", LookAt:=xlPart,

SearchOrder
_
:=xlByRows, MatchCase:=False
Cells.Replace What:="g", Replacement:="ð", LookAt:=xlPart,

SearchOrder
_
:=xlByRows, MatchCase:=False
Cells.Replace What:="u", Replacement:="ü", LookAt:=xlPart,

SearchOrder
_
:=xlByRows, MatchCase:=False
End Sub
'--------------------------------
but I need to do it far "all" existing Sheets in the workbook all in one
go...
Thanks
J_J

"Bob Phillips" wrote in message
...
Record a macro in Excel that does it, and you will then know you can.

--

HTH

RP

"J_J" wrote in message
...
Hi,
Can I replace (all "i" characters with "ý") and (all "g" characters

with
"ð") and (all "u" characters with "ü") within all cells of all Excel
sheets
in a workbook with a VB macro?
TIA













  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 12
Default can I replace all with a macro?

I think Bob meant:
Private Sub ReplaceAll(sh As Worksheet, pWhat As String, pBy As String)
sh.Cells.Replace What:=pWhat, _
Replacement:=bBy, _
LookAt:=xlPart, _
SearchOrder:=xlByRows, _
MatchCase:=False
End Sub


--
If I've mis-understood the question please tell me.

HTH

ijb

Remove nospam from my e-mail address to talk direct

Not MCSD, MVP, TLA, P&P, PCMCIA, etc just trying to help


"Bob Phillips" wrote in message
...
J_J,

This is untested, but fingers-crossed

Sub Macro1()
Dim sh As Worksheet
For Each sh In Activeworkbook.Worksheets
ReplaceAll sh, "i","y"
ReplaceAll sh, "g", "ð"
ReplaceAll sh, "u", "ü"
Next sh
End Sub

Private Sub ReplaceAll(sh As Worksheet, pWhat As String, pBy As String)
sh.Cells.Replace What:="i", _
Replacement:="ý", _
LookAt:=xlPart, _
SearchOrder:=xlByRows, _
MatchCase:=False

End Sub

--

HTH

RP

"J_J" wrote in message
...
Hi Bob,
Thanks for your suggestion. Yes the below code "partly" does the job
'--------------------------------
Sub Macro1()
' Macro1 Macro
' Macro recorded 20.10.2004 by J_J
Cells.Replace What:="i", Replacement:="ý", LookAt:=xlPart,
SearchOrder

_
:=xlByRows, MatchCase:=False
Cells.Replace What:="g", Replacement:="ð", LookAt:=xlPart,
SearchOrder

_
:=xlByRows, MatchCase:=False
Cells.Replace What:="u", Replacement:="ü", LookAt:=xlPart,
SearchOrder

_
:=xlByRows, MatchCase:=False
End Sub
'--------------------------------
but I need to do it far "all" existing Sheets in the workbook all in one
go...
Thanks
J_J

"Bob Phillips" wrote in message
...
Record a macro in Excel that does it, and you will then know you can.

--

HTH

RP

"J_J" wrote in message
...
Hi,
Can I replace (all "i" characters with "ý") and (all "g" characters

with
"ð") and (all "u" characters with "ü") within all cells of all Excel
sheets
in a workbook with a VB macro?
TIA











  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default can I replace all with a macro?

Course I did, and I also spotted it <vbg

Bob

"ijb" wrote in message
...
I think Bob meant:
Private Sub ReplaceAll(sh As Worksheet, pWhat As String, pBy As String)
sh.Cells.Replace What:=pWhat, _
Replacement:=bBy, _
LookAt:=xlPart, _
SearchOrder:=xlByRows, _
MatchCase:=False


End Sub


--
If I've mis-understood the question please tell me.

HTH

ijb

Remove nospam from my e-mail address to talk direct

Not MCSD, MVP, TLA, P&P, PCMCIA, etc just trying to help


"Bob Phillips" wrote in message
...
J_J,




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
macro - replace Rohit New Users to Excel 2 March 26th 10 04:19 AM
macro to replace puiuluipui Excel Discussion (Misc queries) 4 January 7th 10 12:23 PM
Macro-replace puiuluipui Excel Discussion (Misc queries) 10 September 20th 09 12:59 PM
Replace Macro Sandy Mann Excel Discussion (Misc queries) 8 December 5th 07 03:05 PM
Macro to replace * with / [email protected] Excel Programming 4 October 6th 04 05:05 PM


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

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

About Us

"It's about Microsoft Excel"