Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.misc
|
|||
|
|||
to replace a value in each cell of a column
Please let me know how I can write a macro in excel to replace a value in
each cell of the entire column example. in column B '1' - replaced with 'Invoice' 'C' - replaced with 'Credit note' I dont not mean in menu - Find - Replace . With thanks Pol |
#2
Posted to microsoft.public.excel.misc
|
|||
|
|||
to replace a value in each cell of a column
Sub Macro1()
Columns("A:A").Replace What:="I", Replacement:="Invoice", _ LookAt:=xlWhole, SearchOrder:=xlByRows Columns("A:A").Replace What:="c", Replacement:="Credit Note", _ LookAt:=xlWhole, SearchOrder:=xlByRows End Sub Why dont you try recording one........ -- If this post helps click Yes --------------- Jacob Skaria "pol" wrote: Please let me know how I can write a macro in excel to replace a value in each cell of the entire column example. in column B '1' - replaced with 'Invoice' 'C' - replaced with 'Credit note' I dont not mean in menu - Find - Replace . With thanks Pol |
#3
Posted to microsoft.public.excel.misc
|
|||
|
|||
to replace a value in each cell of a column
Sub replacer()
n = Cells(Rows.Count, "B").End(xlUp).Row For i = 1 To n With Cells(i, "B") If .Value = 1 Then .Value = "Invoice" If .Value = "C" Then .Value = "Credit note" End With Next End Sub -- Gary''s Student - gsnu200854 |
#4
Posted to microsoft.public.excel.misc
|
|||
|
|||
to replace a value in each cell of a column
Thanks it is working fine. Thansk a lot
"Jacob Skaria" wrote: Sub Macro1() Columns("A:A").Replace What:="I", Replacement:="Invoice", _ LookAt:=xlWhole, SearchOrder:=xlByRows Columns("A:A").Replace What:="c", Replacement:="Credit Note", _ LookAt:=xlWhole, SearchOrder:=xlByRows End Sub Why dont you try recording one........ -- If this post helps click Yes --------------- Jacob Skaria "pol" wrote: Please let me know how I can write a macro in excel to replace a value in each cell of the entire column example. in column B '1' - replaced with 'Invoice' 'C' - replaced with 'Credit note' I dont not mean in menu - Find - Replace . With thanks Pol |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
to replace a value in each cell of the column | Excel Discussion (Misc queries) | |||
How to search in one column, and replace in the other column if fo | Excel Discussion (Misc queries) | |||
Can I replace a ' at the beginning of a text cell using Replace | Excel Discussion (Misc queries) | |||
Replace all non blanks in a column with column header | Excel Discussion (Misc queries) | |||
Find and Replace in a column | New Users to Excel |