New Excel Forum

This forum has been moved to TeachExcel.com

Ask all future questions in the New Excel Forum.

ExcelKey

Repopulating text box from concatenated cell value

Macros, VBA, Excel Automation, etc.

Repopulating text box from concatenated cell value

Postby Lazmail » Tue Apr 26, 2016 5:06 am

Hi Guys,

I have been able to successfully concatenate the values of 3 Text Boxes in a user form and place them in a dedicated cell in another spreadsheet as alluded to below.

textbox1=0412, textbox2=123, and textbox3=678
Sheet("sheetname") Cell( "L9")= 0412-123-678

I would like to be able to take the value in this cell and repopulate the pertinent text box in the User form.

The textbox1.value, textbox2.value, and textbox3.value have all been concatenated in worksheet("sheetname")Cell ("L9)".

I now wish to be able to use the, left((L9),4) , Mid((L9),6,3) and right((L9),3) to provide the values for textbox1, textbox2 and textbox3 in that order.

Can anyone please help me or am I expecting too much from good old Excel.

I am using Excel 2010 for this project.

Thank you all in advance.
  • 0

Lazmail
Rookie
 
Posts: 14
Joined: Feb 3, 2015
Reputation: 0
Excel Version: 2007

Re: Repopulating text box from concatenated cell value

Postby NoSparks » Tue Apr 26, 2016 6:43 pm

have you tried anything like what you wish for ?
perhaps
Code: Select all
Textbox1.Value = left(worksheets("sheetname").Range("L9").Value,4)
  • 0

NoSparks
Excel Hobbyist
 
Posts: 637
Joined: May 28, 2014
Reputation: 103
Excel Version: 2010

Re: Repopulating text box from concatenated cell value

Postby Lazmail » Tue Apr 26, 2016 6:57 pm

Thanks No Sparks,

I will keep you posted, I am at work at the moment so not able to try the code but I think it is what I am looking for.

If I am to search for the Mid length I assume that it would be something similar.

Textbox1.Value = Mid(worksheets("sheetname").Range("L9").Value,6,3) ??????

Cheers
  • 0

Lazmail
Rookie
 
Posts: 14
Joined: Feb 3, 2015
Reputation: 0
Excel Version: 2007

Re: Repopulating text box from concatenated cell value

Postby Lazmail » Wed Apr 27, 2016 5:29 am

High No Sparks,

Just to let you know that your code worked a treat, after some massaging I was able to get my problem sorted.
Please do not leave town as I will probably require your assistance again at some future point in time.

Cheers Lazmail.
  • 0

Lazmail
Rookie
 
Posts: 14
Joined: Feb 3, 2015
Reputation: 0
Excel Version: 2007


Return to Macros and VBA Questions

Who is online

Users browsing this forum: Google [Bot], Google Adsense [Bot] and 24 guests

cron