Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
Hello,
I'm new to this group I've got a "student names" column (about 3000 names) and a "student comments" column (about 23,000 comments). I would like to replace all names appearing in "student comments" entries with an X by matching with entries in "student names" column. Is there a way of automating this with an Excel function? I'm using Excel 2007 and am a "basic" Excel user. Thanks in advance |
#2
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
Let's assume that the names are in column A and the comments are in column B.
Enter and run this small macro: Sub Macro2() n = Cells(Rows.Count, "A").End(xlUp).Row For i = 1 To n v = Cells(i, "A").Value Columns("B:B").Replace What:=v, Replacement:="X", LookAt:=xlPart, _ SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _ ReplaceFormat:=False Next End Sub Data that starts out looking like: John Smith John Smith is nice. Mary Mary is good James James is better Larry Moe Curley will become: John Smith X is nice. Mary X is good James X is better Larry Moe Curley Macros are very easy to install and use: 1. ALT-F11 brings up the VBE window 2. ALT-I ALT-M opens a fresh module 3. paste the stuff in and close the VBE window If you save the workbook, the macro will be saved with it. To remove the macro: 1. bring up the VBE window as above 2. clear the code out 3. close the VBE window To use the macro from Excel: 1. ALT-F8 2. Select the macro 3. Touch RUN To learn more about macros in general, see: http://www.mvps.org/dmcritchie/excel/getstarted.htm -- Gary''s Student - gsnu200787 "Eilean" wrote: Hello, I'm new to this group I've got a "student names" column (about 3000 names) and a "student comments" column (about 23,000 comments). I would like to replace all names appearing in "student comments" entries with an X by matching with entries in "student names" column. Is there a way of automating this with an Excel function? I'm using Excel 2007 and am a "basic" Excel user. Thanks in advance |
#3
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
Thank you very, very much!! Exactly what I was after!
All the best, Eilean "Gary''s Student" wrote: Let's assume that the names are in column A and the comments are in column B. Enter and run this small macro: Sub Macro2() n = Cells(Rows.Count, "A").End(xlUp).Row For i = 1 To n v = Cells(i, "A").Value Columns("B:B").Replace What:=v, Replacement:="X", LookAt:=xlPart, _ SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _ ReplaceFormat:=False Next End Sub Data that starts out looking like: John Smith John Smith is nice. Mary Mary is good James James is better Larry Moe Curley will become: John Smith X is nice. Mary X is good James X is better Larry Moe Curley Macros are very easy to install and use: 1. ALT-F11 brings up the VBE window 2. ALT-I ALT-M opens a fresh module 3. paste the stuff in and close the VBE window If you save the workbook, the macro will be saved with it. To remove the macro: 1. bring up the VBE window as above 2. clear the code out 3. close the VBE window To use the macro from Excel: 1. ALT-F8 2. Select the macro 3. Touch RUN To learn more about macros in general, see: http://www.mvps.org/dmcritchie/excel/getstarted.htm -- Gary''s Student - gsnu200787 "Eilean" wrote: Hello, I'm new to this group I've got a "student names" column (about 3000 names) and a "student comments" column (about 23,000 comments). I would like to replace all names appearing in "student comments" entries with an X by matching with entries in "student names" column. Is there a way of automating this with an Excel function? I'm using Excel 2007 and am a "basic" Excel user. Thanks in advance |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Formula to Identify Col Data-Pairs that Differ by 2*pi | Excel Worksheet Functions | |||
Identify last row of populated data | Excel Worksheet Functions | |||
identify duplicate data upon entry of that data | Excel Discussion (Misc queries) | |||
identify different data in two columns | Excel Discussion (Misc queries) | |||
identify data in a cell that has a number as the second character | Excel Worksheet Functions |