PDA

View Full Version : Print text problems and other: please help!



DannyBOHLEN
02-27-2012, 10:44 AM
Hi :hi:

I have made an application in excel 2010 and, when I was ready to finish it, I had some problems :banghead: , and I strongly wish to fix this: :help

1. I have one textbox (set with multiline property true) which shows me a text (with many paragraphs); I want to print this (simple) text to (default) a printer, ONLY THE TEXT, not the textbox, not the cells, not the sheet, not the workbook !
For example, the textbox, at a certain moment, contained the text ”My text to print” & vbNewLine & ”second line to print”, I want to print to a printer JUST the text ”My text to print / second line to print” and nothing else.
I found a solution for this problem, but I don”t want to use this: I save the text in a text file to my HDD, and after that I should open the file and print this file (also my text).


2. In a (protected) sheet, I have (for example) 10 controls! I want to navigate (CHANGE FOCUS), in a specific order, between these controls with tab key (shift tab) or arrows keys! Why? It”s hard to work only with the mouse!

:friends: Thanks for all in advance! :bow:

DannyBOHLEN
03-14-2012, 07:54 AM
2. In a (protected) sheet, I have (for example) 10 controls! I want to navigate (CHANGE FOCUS), in a specific order, between these controls with tab key (shift tab) or arrows keys! Why? It”s hard to work only with the mouse!





Private Sub TextBox1_KeyUp(ByVal KeyCode As MSForms.ReturnInteger, ByVal Shift As Integer)
If KeyCode = 9 Then
Application.ScreenUpdating = False
If Shift = 0 Then
TextBox2.Activate
Else
TextBox4.Activate
End If
Application.ScreenUpdating = True
End If
End Sub

Private Sub TextBox2_KeyUp(ByVal KeyCode As MSForms.ReturnInteger, ByVal Shift As Integer)
If KeyCode = 9 Then
Application.ScreenUpdating = False
If Shift = 0 Then
TextBox3.Activate
Else
TextBox1.Activate
End If
Application.ScreenUpdating = True
End If
End Sub

Private Sub TextBox3_KeyUp(ByVal KeyCode As MSForms.ReturnInteger, ByVal Shift As Integer)
If KeyCode = 9 Then
Application.ScreenUpdating = False
If Shift = 0 Then
TextBox4.Activate
Else
TextBox2.Activate
End If
Application.ScreenUpdating = True
End If
End Sub

Private Sub TextBox4_KeyUp(ByVal KeyCode As MSForms.ReturnInteger, ByVal Shift As Integer)
If KeyCode = 9 Then
Application.ScreenUpdating = False
If Shift = 0 Then
TextBox1.Activate
Else
TextBox3.Activate
End If
Application.ScreenUpdating = True
End If
End Sub



and so on...

the solution was found by Patrick Sawyer (Germania) :beerchug: