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.
 

Some videos you may like

Excel Facts

Excel Joke
Why can't spreadsheets drive cars? They crash too often!

Nicero

New Member
Joined
Aug 13, 2012
Messages
8
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:

Watch MrExcel Video

Forum statistics

Threads
1,099,573
Messages
5,469,472
Members
406,655
Latest member
pwilson06

This Week's Hot Topics

Top