VBA Userform - Textbox not displaying all characters from a datasheet

ian9999

New Member
Joined
Apr 5, 2008
Messages
48
Office Version
  1. 365
Platform
  1. Windows
Hi all

I have designed a user form to control what is entered into a data table, one of the fields is a free text option via a textbox.

The user has the ability to enter as many characters as they wish, but when the user forms updates it only shows 254 characters.

To retrieve data from the data table, a loop is used and it circulates through a list of fields.

Could be causing the problem?

Regards

Ian
 

Excel Facts

Links? Where??
If Excel says you have links but you can't find them, go to Formulas, Name Manager. Look for old links to dead workbooks & delete.
Here is the code

Private Sub LiveSection()

Dim Worksheet As Worksheet
Dim Count1 As Long 'This is used to determine how many items to loop through for Live Contracts Text & Numbers
'Live Text Section
Set Worksheet = ThisWorkbook.Sheets("LookupNew") 'This sets the sheet to be used
Count1 = Worksheet.Range("BE1", Worksheet.Range("BE1").End(xlDown)).Rows.count 'Counts the number of items in the range

Contract = Application.VLookup(CboContractNumber.Value, Sheets("LookupNEW").Range("AX1:AY4000"), 2, False)

ContractLive = Application.WorksheetFunction.IfError(Application.VLookup(Contract, Sheets("LookupNEW").Range("BA1:BC4000"), 1, False), Application.WorksheetFunction.IfError(Application.VLookup(Contract, Sheets("LookupNEW").Range("BB1:BC4000"), 2, False), 0))
CounterLive = 1 'Sets counter to 1

Do Until CounterLive > Count1 'This is to stop the loop when the counter is greater than the count of the number of items
ColumnNameFinderLive = Sheets("LookupNEW").Range("BE" & CounterLive).Value
Textbox = Sheets("LookupNEW").Range("BF" & CounterLive).Value
ColumnFinderLive = WorksheetFunction.Match(ColumnNameFinderLive, Sheets("Master Data NEW").Range("A2:EZ2"), 0)
If IsEmpty(Application.VLookup(ContractLive, Sheets("Master Data NEW").Range("A:EZ"), ColumnFinderLive, False)) = False Then

Me.Controls(Textbox) = Application.VLookup(ContractLive, Sheets("Master Data NEW").Range("A:EZ"), ColumnFinderLive, False)
Else
End If
CounterLive = CounterLive + 1 'This adds 1 to the counter for each loop

Loop

End Sub
 
Upvote 0
Solution

Forum statistics

Threads
1,213,565
Messages
6,114,337
Members
448,568
Latest member
Honeymonster123

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top