Extracting Text to Separate Textboxes

N

Nausett

I have a userform where users input their name, department, phone#, fax# and
email. This information is input into one cell on a worksheet. The cell is
formatted using chr(10) between each. I want to be able to edit the user
information by breaking it back out of the cell an into a userform with 5
textboxes. The text length varies by user. Is there a way to accomplish
this in VBA?
 
A

Ardus Petus

Dim res as Variant
res=Split(Range("A1"),chr(10))

tbName.value=res(0)
tbDept.Value=res(1)
....


HTH
 

Ask a Question

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.

Ask a Question

Top