Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Instr and Mid statements to find/replace data from 1 wksht to another 1

Status
Not open for further replies.

scpankow

MIS
May 14, 2008
10
US
I have one worksheet that has four columns, Description, Category, New Number, Old Number. I have a second worksheet that has four columns, Sec. Reg. No., HIPAA Req., Doc. Type, and Doc. Name/Description. I need to search the data in the Doc. Name/Description field for Old Numbers and replace them with the corresponding New Numbers from the first sheet. I believe that I need to use Instr and Mid, but I am a VBA newbie and not sure how to do so. Any and all help would be greatly appreciated.

Thanks,

Shannon
 
Set s2 = Workbooks("GuidelinesMapping_oldtonew.xls").Sheets("Sheet1")
Either there is no "GuidelinesMapping_oldtonew.xls", or it isn't open, or it doesn't have a sheet named "Sheet1".

What is the <do your thing>?
That's what I don't know. Now that you've found a cell in s1 that has a value that contains a value in s2, what do you want to do?

_________________
Bob Rashkin
 




FYI: Looping thru cells to make multiple changes is slooooower than doing Edit > Replace.

Skip,

[glasses]Just traded in my old subtlety...
for a brand NUANCE![tongue]
 
I want to take the value that I found in s1 and replace it with the value that is in the adjacent cell to the left of the value in s2.

Shannon
 
Skip is absolutely correct. Again, if we saw the data, it might be possible to help you do it more efficiently.

_________________
Bob Rashkin
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top