Add two type mix font in one cell in excel 2003 [Solved/Closed]

Posts
9
Registration date
Sunday July 14, 2013
Last seen
August 21, 2015
- - Latest reply: aptpsbwmraj
Posts
9
Registration date
Sunday July 14, 2013
Last seen
August 21, 2015
- Aug 17, 2013 at 10:00 AM
hallo
i have a excel 2003 userform with textbox . I have problem in my data base . I have 2 type font in my data like DevLys 010 and arial. I want to type both font in textbox at same time and get it in sheets cell A41 . I try but I cant make it . I m new in excel vba could some one plese make it possible for me. thanks in advance. PLEASE HELP. THANKS
See more 

4 replies

Best answer
Posts
2448
Registration date
Sunday September 12, 2010
Status
Contributor
Last seen
February 14, 2019
409
3
Thank you
Sure thing.

Here you go:
Private Sub CommandButton1_Click()
Dim x, y, z As Integer

Range("A41").Font.Name = "Agency FB"
x = Len(TextBox1)
y = Len(TextBox1) + Len(TextBox2)
z = Len(TextBox3)
Range("A41") = TextBox1 & TextBox2 & TextBox3 & TextBox4
Range("A41").Characters(1, x).Font.Name = "Arial"
Range("A41").Characters(y, z).Font.Name = "Arial"

Unload UserForm1
End Sub

Best regards,
Trowa

Say "Thank you" 3

A few words of thanks would be greatly appreciated. Add comment

CCM 4317 users have said thank you to us this month

aptpsbwmraj
Posts
9
Registration date
Sunday July 14, 2013
Last seen
August 21, 2015
-
Thanks Friend
Posts
2448
Registration date
Sunday September 12, 2010
Status
Contributor
Last seen
February 14, 2019
409
0
Thank you
Hi,

Not sure if I can solve this one. What could make it easier is if there are patterns to what you enter in the textbox.
Like:
Only 2 words are entered.
Specific lengths of words.
First or second word can only be a certain word.
...
etc..

Best regards,
Trowa
aptpsbwmraj
Posts
9
Registration date
Sunday July 14, 2013
Last seen
August 21, 2015
-
thanks TrowaD for reply
we have lots of letters in office and my work is type them in excel. in these letter they (clients)have use english word any where not in a specific position :( this is my problem. when I type these letter we have a particular formate in excel sheet and letter are type in sheets cell A41. I can make user form for all details of formate but this problem cant solve . please help
aptpsbwmraj
Posts
9
Registration date
Sunday July 14, 2013
Last seen
August 21, 2015
-
sorry for bad english
Posts
9
Registration date
Sunday July 14, 2013
Last seen
August 21, 2015
0
Thank you
is there no one can solve my problem :(
Posts
2448
Registration date
Sunday September 12, 2010
Status
Contributor
Last seen
February 14, 2019
409
0
Thank you
Hi,

I think I got a nice solution.
Create an extra textbox.
Format A41 with the second font.
Determine length of the 1ste textbox.
Put both textboxes in A41.
Change the font of the determined length.

Here is the code I used to test my theory:
Dim x As Integer
Range("A41").Font.Name = "Agency FB"
x = Len(TextBox1)
Range("A41") = TextBox1 & TextBox2
Range("A41").Characters(1, x).Font.Name = "Arial"

Best regards,
Trowa
aptpsbwmraj
Posts
9
Registration date
Sunday July 14, 2013
Last seen
August 21, 2015
-
thanks alot
you solve my problem
you r my super man :)
aptpsbwmraj
Posts
9
Registration date
Sunday July 14, 2013
Last seen
August 21, 2015
-
sorry for disturb you again. but can you tell me how to set in four textboxes . like agency fb then arial then agency fb then arial . thanks for suport.