Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 102
Default Macro to replace * with /

Well here's a rather embarassing problem.

I sent out about a kazillion files for people to enter information in
and one of the columns has a =Cell*12 in it where cell is the cell
address over dozens of rows (e.g.

=aa10*12
=aa11*12
etc.

I thought it would be simple to do a record macro to replace the * with
a / but something that I thought would be trival has escaped me....
any help would be appreciated.

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Macro to replace * with /

to replace *, you would use ~*

Sub Macro5()
Cells.Replace What:="~*", Replacement:="/", LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
End Sub


--
Regards,
Tom Ogilvy



" wrote in message
ups.com...
Well here's a rather embarassing problem.

I sent out about a kazillion files for people to enter information in
and one of the columns has a =Cell*12 in it where cell is the cell
address over dozens of rows (e.g.

=aa10*12
=aa11*12
etc.

I thought it would be simple to do a record macro to replace the * with
a / but something that I thought would be trival has escaped me....
any help would be appreciated.



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Macro to replace * with /


Excel hates searching for a wild card...

One way I know is to create a macro to do it. In the VB editor, inser
a module and enter the following code:

Sub Repl()

Dim c As Range
Application.ScreenUpdating = False
For Each c In ActiveSheet.UsedRange
c.Formula = Replace(c.Formula, Chr(42), "/")
Next

End Sub

Then from the sheet you wish to search and replace, select Tools
Macro -- Macros and then select that macro from the list.

Don't know of a better way... Sorry.



--
kkkni
-----------------------------------------------------------------------
kkknie's Profile: http://www.excelforum.com/member.php...nfo&userid=754
View this thread: http://www.excelforum.com/showthread.php?threadid=26661

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Macro to replace * with /


Aha!

You don't even need to write code. Just type in ~* in the find and
in the replace for a find/replace dialog (with all cells selected).

Is that escape character documented anywhere???



--
kkkni
-----------------------------------------------------------------------
kkknie's Profile: http://www.excelforum.com/member.php...nfo&userid=754
View this thread: http://www.excelforum.com/showthread.php?threadid=26661

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 102
Default Macro to replace * with /

I needed code because there are something like 1200 files that are
already in the hot hands of others that I needed to be able to make the
change to. Using a macro allows me to send a folks a method that can
automatically open their files and make the change. Not to mention,
that doing this to 1200 files by hand would have been tiresome

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
replace macro? andrewm Excel Worksheet Functions 1 October 19th 05 12:47 PM


All times are GMT +1. The time now is 05:13 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"