View Single Post
  #7   Report Post  
Posted to microsoft.public.excel.misc
Eduardo Eduardo is offline
external usenet poster
 
Posts: 2,276
Default to replace a value in each cell of the column

Hi Pol,
Sub Replace()
'
' MacroReplace Macro
'

'
Columns("C:C").Select
Range("c1").Activate
Selection.Replace What:="I", Replacement:="Invoice", LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
End Sub

"pol" wrote:

Thanks for the reply. I want to use a macro to find and replace

I - replace with Invoice
C - Replaced with Credit

I cannot use menu option edit- find and replace. I have to use macro to
find I and C in all the cells of the column C

"Eduardo" wrote:

Hi,
I don't know if I understand you want to replace the I for Invoice and the C
with the word Credit if yes hit CTRL H , where it says find what enter I and
in replace with enter Invoice and then do it again to change the C if I
misunderstood you please give me an example thanks
If this was helpful please click yes, thanks

"pol" wrote:

Dear All,

In an excel have a column with a name 'TRANTYPE' ie in B1 cell in which
contain the value 'I' and 'C'. 'I' for Invoice and 'C' for credit. I want
to replace all the values in a cell as follows
if the value is 'I' it should be replaced with 'Invoice'
if the value is 'C' it should be replaced with 'Credit' in all the cell of
that column.

Please help .

Pol