PDA

View Full Version : VBA to compare string and replace a sub string with other value



subu86
12-02-2013, 11:15 PM
Hello Experts, I need help in a code.I have a string of names (in sheet 1 of attached excel), which need to be abbreviated as per abbreviations in sheet 2.Desired result after abbreviating shall be pasted in second column of sheet 1, i have shown results in column 2 for example.Sheet 1Name Short Name (Desired Result)Saha Subu Sa SuSameer Saha Sameer SaRicha Subu Richa SuParul Saha Parul SaPink Subu Pink SuSheet 2Name AbbreviationSaha SaSubu Su

mancubus
12-03-2013, 02:53 AM
welcome to the forum. which attached file?:)

subu86
12-03-2013, 03:23 AM
welcome to the forum. which attached file?:)I was unable to attach file. Sheet 1 has entries as follows Row A Header "Name"1. Saha Subu2. Sameer Saha3. Richa Subu4. Parul Saha5. Pink SubuRow B Header "Short Name"1. Sa Su2. Sameer Sa3. Richa Su4. Parul Sa5. Pink SuSheet 2 has entries as followsRow A Header "name"1. Saha2. SubuRow B Header "Abbreviation"1. Sa2. Su

mancubus
12-03-2013, 09:30 AM
its easy. click GO ADVANCED (which is below Quick Reply). scroll down to MANAGE ATTACHMENTS. upload your file with input and desired output. i dont understand the requirement from your post.