For example, 1.1234.12345.1234 and I would need to be able to pull out the 12345 to be able to vlookup to a table with descriptions.

Does anyone know if this is possible?

- Thread starter CarolB
- Start date

For example, 1.1234.12345.1234 and I would need to be able to pull out the 12345 to be able to vlookup to a table with descriptions.

Does anyone know if this is possible?

Ad

Public Sub MultColTxtToCol()

'This routine runs the Text To Column function on all selected columns

Dim intCol As Integer, intx As Integer, intCurrentCol As Integer

intCurrentCol = ActiveCell.Column

intCol = Selection.Columns.Count

For intx = intCurrentCol To intCurrentCol + intCol - 1

Columns(intx).Select

Selection.TextToColumns Destination:=Selection, DataType:=xlDelimited, _

TextQualifier:=xlDoubleQuote, ConsecutiveDelimiter:=False, Tab:=True, _

Semicolon:=False, Comma:=False, Space:=False, Other:=False, FieldInfo _

:=Array(1, 1), TrailingMinusNumbers:=True

Next

MyEndMessage

End Sub

- Joined
- Jun 9, 2016

- Messages
- 32

- Reaction score
- 5

How would we know which section to pull out for the VLOOKUP?

For example, 1.1234.12345.1234 and I would need to be able to pull out the 12345 to be able to vlookup to a table with descriptions.

Does anyone know if this is possible?

1.1234.12345.1234 has four sections. Will there always be four sections? If not, what is the maximum number of sections? Will it always be the same section, e.g. will the third section always be the one used for the VLOOKUP?

Last edited:

Ad

**Want to reply to this thread or ask your own question?**

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.