Hi guys,
I need some help creating a find & replace macro, with the find/replace values contained in a completely separate Excel file. Here's the scenario:
I'll have a list file: D:\\Excel Files\List.xlsx
This file contains only 2 columns, one titled "Name" & the other titled "ID#".
Under these header names are thousands of rows of names & their corresponding ID numbers.
This file will never actually be opened unless it's to update the list of Names & ID#'s.
Now, I will have other files (obtained from various sources) which I need to use the contents of the file above in order to run a macro that will do a find & replace, to convert from "Name" to "ID#", or from "ID#" to "Name", depending on the current value and/or header name...basically the opposite of whatever the value is currently (each file will only have one or the other, there will never be a combination of both within a single file). The column containing this info will not always be in a specific column, but they will always be named either "Name" or "ID#". If the column header is "ID#", I want the macro to replace the values under it with the ones in the "Name" column of my "List" file, and if the column header is "Name", I want the macro to replace the values under it with the ones in the "ID#" column of my "List" file. Also, case-sensitivity and preceding zeroes must be kept intact when the values are replaced. For example:
This name = 00098348 ID#
this name = 32800123 ID#
I don't want the macro to find "This", and replace it with the ID# of 32800123. I also do not want "This" to be replaced with "98348", but with exactly "00098348".
I have come across this post, and have been trying to modify it for my needs, but I can't seem to get it working, and the author of that macro hasn't been active on here since 2014.
I'll keep poking around with it, but if someone could help out, it would be greatly appreciated.
I need some help creating a find & replace macro, with the find/replace values contained in a completely separate Excel file. Here's the scenario:
I'll have a list file: D:\\Excel Files\List.xlsx
This file contains only 2 columns, one titled "Name" & the other titled "ID#".
Under these header names are thousands of rows of names & their corresponding ID numbers.
This file will never actually be opened unless it's to update the list of Names & ID#'s.
Now, I will have other files (obtained from various sources) which I need to use the contents of the file above in order to run a macro that will do a find & replace, to convert from "Name" to "ID#", or from "ID#" to "Name", depending on the current value and/or header name...basically the opposite of whatever the value is currently (each file will only have one or the other, there will never be a combination of both within a single file). The column containing this info will not always be in a specific column, but they will always be named either "Name" or "ID#". If the column header is "ID#", I want the macro to replace the values under it with the ones in the "Name" column of my "List" file, and if the column header is "Name", I want the macro to replace the values under it with the ones in the "ID#" column of my "List" file. Also, case-sensitivity and preceding zeroes must be kept intact when the values are replaced. For example:
This name = 00098348 ID#
this name = 32800123 ID#
I don't want the macro to find "This", and replace it with the ID# of 32800123. I also do not want "This" to be replaced with "98348", but with exactly "00098348".
I have come across this post, and have been trying to modify it for my needs, but I can't seem to get it working, and the author of that macro hasn't been active on here since 2014.
I'll keep poking around with it, but if someone could help out, it would be greatly appreciated.