• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

The zero does not appear at the beginning of the text when querying for data in the UseForm (VBA)

خليل

New Member
The problem is as follows: Zeros do not appear at the beginning of the text box when querying for data I mean, I enter the phone number of one of the employees and make the number as follows. 00076543102 The number is written correctly in the textbox and transferred to the sheet also correctly, and a zero appears at the beginning of the number in the Excel sheet Up to here things are going well The problem is when inquiring about the employee's data in the UserForm , the data is fetched or recalled, and the number appears without the zeros at the beginning This means that it appears in the userform as follows: 76543102 I want to print the userform, but the zero is not present at the beginning of the textbox, meaning that the phone number is incomplete and incorrect because zeros do not appear at the beginning of the number.
I want when I query data in UseForm, I want zeros to appear at the beginning of the number I hope you get the idea I hope someone can help me Thank you very much
 
خليل
What do You have in sheet's cell?
( I don't ask - what do You see? )
Do You take that 'zero-leading-number' as a string?
if those phone numbers are always have ten numbers then here two ideas ...
#1 format those phone numbers with "0000000000"
#2 add nine leading zeros to the phone number and use the latest ten of those.
 
84362LRWY9TTyB6Seb177XDTrBMYQ.jpg
Look at this picture and you will get the idea Look at the number below the circle Zeros did not appear to the left of the number inside the textbox, and this is the problem I want zeros to appear at the beginning of this number in the user form itself. For Excel or sheet cells, there is no problem with zeros showing up
 
84363
This image is translated Of course, the number is supposed to be 11 digits This is the personal card number, not the phone number
 
خليل
What do You have in sheet's cell?
( I don't ask - what do You see? )
Please reread my #2 reply ...
and try to answer to my question.
As well as .. did You test those two possible solutions?
In many times - if You use numbers then Excel will act with those like numbers.
Normally, there are no zeros in front of numbers.
 
Back
Top