Overcome / exceed / overtake maximum limit of textbox in userform

Nicero

New Member
Joined
Aug 13, 2012
Messages
8
I'm using Excel as a primitive but very practical offline grid database. When needed, the Excel file is then uploaded and it populates a mySQL db.

Now I added the support to images by encoding them base64 and save the string into a cell (mySQL will use the content of the cell to fill a BLOB record).

Everything works fine but now I would like to solve the case that Excel text boxes have a maximum lenght of 32,000 characters (it may happen that the result string of an image base64 encoded has more than 32,000 characters).

I know that I can overcome this limit by selecting the cell and set a new maximum limit using the 'data validate' menu option. The problem is that using the menu option is limited to the selected cells, so if I delete the cell or the whole row my setting is lost. I would like to set this limit by code inside the userform using Vba.

Is it possible? I did not find any property about.

Many thanks.
 

Excel Facts

VLOOKUP to Left?
Use =VLOOKUP(A2,CHOOSE({1,2},$Z$1:$Z$99,$Y$1:$Y$99),2,False) to lookup Y values to left of Z values.
Ok, I worked it out by myself:

Code:
    With Range("R3:R1000").Validation
        .Delete
        .Add Type:=xlValidateTextLength, _
              Operator:=xlBetween, _
              Formula1:="2", _
              Formula2:="3000000"
        .IgnoreBlank = True
        .ShowError = False
    End With
 
Last edited:
Upvote 0

Forum statistics

Threads
1,214,647
Messages
6,120,722
Members
448,987
Latest member
marion_davis

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