ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Extracting Text to Separate Textboxes (https://www.excelbanter.com/excel-programming/364821-extracting-text-separate-textboxes.html)

Nausett

Extracting Text to Separate Textboxes
 
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?

Ardus Petus

Extracting Text to Separate Textboxes
 
Dim res as Variant
res=Split(Range("A1"),chr(10))

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


HTH
--
AP

"Nausett" a écrit dans le message de
news: ...
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?




Nausett

Extracting Text to Separate Textboxes
 
Thank you. That worked perfectly.

"Ardus Petus" wrote:

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

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


HTH
--
AP

"Nausett" a écrit dans le message de
news: ...
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?






All times are GMT +1. The time now is 03:32 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com