Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Replace cell of column with cell of other workbook
Hello,
I have the following problem. In one sheet I have a table with imported keys from an access table. Now I want to replace these keys with strings that are in a second worksheet. So eg when a cell in the 1st sheet has value 2 it has to be replaced by eg "the second"... How can I do this for all the cells of that column automatically? Thanks a lot. Kristof |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Replace cell of column with cell of other workbook
This is one of those cases where doing it with the macro
recorder turned on allows you to see quite easily how to do this. Review the code, then simply edit it to make it more applicable generally. Here's the result of my record & adjustment: Sub Macro1() Dim ReplaceWhat As String Dim ReplaceWith As String Dim SearchCol As String ReplaceWhat = "Test" ReplaceWith = "NewStuff" SearchCol = "B" Columns(SearchCol).Replace What:=ReplaceWhat, Replacement:=ReplaceWith, LookAt:=xlPart, _ SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _ ReplaceFormat:=False End Sub Patrick Molloy Microsoft Excel MVP -----Original Message----- Hello, I have the following problem. In one sheet I have a table with imported keys from an access table. Now I want to replace these keys with strings that are in a second worksheet. So eg when a cell in the 1st sheet has value 2 it has to be replaced by eg "the second"... How can I do this for all the cells of that column automatically? Thanks a lot. Kristof . |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Replace cell of column with cell of other workbook
Multiposted in misc + newusers + programming + worksheet.functions.
Aarrgghhhh!!!! |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
to replace a value in each cell of a column | Excel Discussion (Misc queries) | |||
to replace a value in each cell of the column | Excel Discussion (Misc queries) | |||
linked workbook cell returns 0 is source workbook cell is blank? | Excel Worksheet Functions | |||
Can I replace a ' at the beginning of a text cell using Replace | Excel Discussion (Misc queries) | |||
Excel - create button to replace cell content with cell value | Excel Worksheet Functions |