supermansteel
New Member
- Joined
- Jun 6, 2014
- Messages
- 9
Trying to get this France-FR;France-FR;France-FR to FR|FR|FR
'Looping through all the Rows in my worksheet
Lastreq = Range("C" & Rows.count).End(xlUp).Row
Set req_Range = Sheets("Range").Range("B1:AD" & Lastreq
LastRow = Range("D" & Rows.Count).End(xlUp).Row
for i = 2 to LastRow
'Lookup Value from another Sheet
req = Sheets("Lookup").Range("E" & i).Value
seg = Application.WorksheetFunction.Vlookup(req, req_Range,26,False)
seg1 = WorkSheetFunction.Substitute(seg,";","|") 'Converts Semi-colon to |
seg2 = Split(seg1,"|")
seg3 = Join(seg2,"|")
'Then I was pasting the Results of this here
Range("AA"& i).Value = seg3
Next
This was working, but now I learned that I only need everything to the right of the "-". I was trying Right, Mid and Find and instr Functions, but keep getting error and can't figure exactly out how to write this to correctly make this as my output FR|FR|FR because of this being an array once you split the items.
Please help
'Looping through all the Rows in my worksheet
Lastreq = Range("C" & Rows.count).End(xlUp).Row
Set req_Range = Sheets("Range").Range("B1:AD" & Lastreq
LastRow = Range("D" & Rows.Count).End(xlUp).Row
for i = 2 to LastRow
'Lookup Value from another Sheet
req = Sheets("Lookup").Range("E" & i).Value
seg = Application.WorksheetFunction.Vlookup(req, req_Range,26,False)
seg1 = WorkSheetFunction.Substitute(seg,";","|") 'Converts Semi-colon to |
seg2 = Split(seg1,"|")
seg3 = Join(seg2,"|")
'Then I was pasting the Results of this here
Range("AA"& i).Value = seg3
Next
This was working, but now I learned that I only need everything to the right of the "-". I was trying Right, Mid and Find and instr Functions, but keep getting error and can't figure exactly out how to write this to correctly make this as my output FR|FR|FR because of this being an array once you split the items.
Please help