Free Microsoft Excel 2013 Quick Reference

Print contents of textbox (has scrollbars)

Hello -

I have a worksheet that includes a textbox. I need to be able to print the
entire contents of it. (It is a fixed size and uses scrollbars to display
all of the text.)

Is there some way I can code the printing of the document to do this?

Any suggestions will be greatly appreciated!

Post your answer or comment

comments powered by Disqus
I am using following code to copy content of TextBox to Cell

ActiveSheet.Shapes("Text Box 9").Select
TempText = Selection.Characters.Text
ActiveCell.FormulaR1C1 = TempText

But when i do a message
MsgBox TempText

It does not contain all the text which Text Box has it gets cut off after
abut 255 characters.

Any help is appreciated.

I am using a multi-line textbox control on my worksheet (multiline = True, WordWrap = True). I don't want the control to 'autosize' on my worksheet, but do want it to autosize when printing. If I change the autosize property in the Workbook_BeforePrint function, how do I change it 'back' when printing is done? Is there another property or method I could use to print the entire contents of my multi-line text box control?

Any suggestions would be greatly appreciated.

Well, here I am, back again, with yet another barrier to breach. I am having a lot of trouble being able to print the contents of a userform textbox. I had seen reference to this on the excel.programming newsgroup that used Windows API calls to carry out this function. Unfortunately, the sample code supplied was for Excel 97, and I am cross-building this application using both Excel 2000 and 2002. I also want it set so that I can set the criteria for what to print (for example, I might want to print all log entries between two dates or just the log entries generated by a certain user.

For that matter, is it possible to set criteria when loading the contents of a file into a textbox?

As always, any help that can be rendered would be greatly appreciated.

I have the attached file that contains two listview.

I wonder, what code to put a second button to print the contents of ListView2?

I want something simple, just print the name of the columns, its contents and now has a title to this "report".


I have read thru 7 pages of posts and did not find what may guide or help me along.

I am placing Command Buttons on a spread sheet, each button will load a UserForm with a TextBox, full of text. The text is instructions on how to perform a task.
How can I print the text within the TextBox?

I have a cell with 4000 characters. I'm using Excel 2003, which has a max print area of 1024. Is there a way, using a macro to force all 4000 characters to print? I am printing the excel file to a pdf.

I will need to set the max column width at 120 and have the text wrap to the next line where necessary. It seems that Excel 2003 also has a max row height of ~409 which poses yet another problem.

Does anyone have any suggestions?

How can I not print contents and/or formating of some cells of my worksheets?


I am trying to get a macro to write the contents of multiple textboxes to a
new workbook. The idea is that the macro would open up a new workbook, write
the contents of the textbox to a named cell range and then save the new
workbook with the name of say range "A1" in the new workbook. Is this

Many thanks as always.
Andy Tallent

Hi, I was wondering if anyone knew how to print the contents of a listbox


I am trying to get a macro to write the contents of multiple textboxes to a
new workbook. The idea is that the macro would open up a new workbook, write
the contents of the textbox to a named cell range and then save the new
workbook with the name of say range "A1" in the new workbook. Is this

Many thanks as always.
Andy Tallent

How to find whether contents of an addin has been changed or not ??

I am trying to maintain versions of addin??

Any ideas about this?

Good Morning,

I have a list of hyperlinks to PDF documents and would like to have an automated way to do the following:

1. Open Link
2. Print Content
3. Close PDF
4. Move to next link in next cell and repeat 1-3

Please help!!!



Hi !

I developed a small macro that prints the content of some cells to a text file.
I use "print" command, but I want to have, let's say , the result of 2 "print" calls on the same line...Now, on each call, it goes to a new line..

Is it possible to do that??? Or maybe using another function??

Also, if I want to echo this character: " , what should I use for that??

Thanks in advance,


Can someone help me with following requirement?

I have few textboxes in a sheet(names query1,query2 etc.). I need to copy the contents of these boxes and paste it in a cell.

Please help me.

Thanks in advance.


I am writing some code to copy data from 1 workbook to another

Am having problems trying to copy the contents of the text boxes.

Am trying to copy the contents of:

Text box 1 in Worksheet 1 in Workbook 1 to

Text box 2 in Worksheet 2 in Workbook 2.

I have tried to use the following VBA code:

Workbooks("2").Worksheets("Sheet2").Shapes("Text Box 2).value = Workbooks("1").Worksheets("Sheet1").Shapes("Text Box 1).value

This does not work

Does anyone know how to do this?

Kind Regards


Hi, there,
I think this should be easy, but I just can't seem to find this information on the board...

I have a bunch of textboxes in a userform. I also have a command button called Button_SaveLoc that I want the user to be able to click so that any changes to the inputed values will be saved into the textboxes when the user open the form again.

Private Sub Button_SaveLoc_Click()
For Each cCont In Me.MultiPage1.Pages(1).Controls
If TypeName(cCont) = "TextBox" Then
???What do I put here???
End If
Next cCont
End Sub

After I enter data into the textboxes, if I close the form and reopen it, my changes have disappeared. How can I get the textboxes to reflect my changes when I open the form again? Am I on the right track? Thank you.

This problem has been driving me up a wall. It seems very easy but I can't
find the answer anywhere.

I have a Userform with a text box on it. I use this textbox to list errors
that my macro finds. I would like my users to be able to print the contents
of the textbox. Any ideas.

I have tried the following.
Printer.Print Userform1.textbox1.text

When I run this code I get an error that says "Object Required"

Any help would be appreciated.


Excel 2003. I have a user form called "ProcessStatus" that has a text box
called "ProcStat" which is populated with information as a process completes.
I have placed a "Print" button control on the form that I want to use to
print the contents of the text box. What code would I use to print the text
box contents?

ProcessStatus.Print does not work as it prints the whole form. The text box
has a verical scroll and thus all text is not printed.

Thanks for any help you may give. God bless.

Dr. Doug Pruiett
Good News Jail & Prison Ministry

I am preparing a monthly summary page containing a text box that has a high probability of having more data entered into it than can be shown on one page.

Indeed, during testing, I have tried exactly that. All that prints when I File>Print is the single page with the text box showing exactly the data that shows on the spreadsheet/view.

Is there a way I can force a second page with the remainder of the contents of the text box printed?



Hope this is clear, but how do I print the contents of a list box that a user inputs into within VBA form?

I understand how to write / print data to files etc but I can not work out how to loop through the list box, and print each entry as a new line in a txt file.

Thanks in advance,


I have a listbox that is populated be the results of a query. I would like to let the user be able to click a print button and have it print the entire contents of that listbox/query instead of it printing the visible area of the form.

This is the code I use to Populate the listbox:
Search Button

    If lstfield.ItemsSelected.Count > 0 Then 
        lstReport.ColumnCount = lstfield.ItemsSelected.Count 
        Call PopulateSQL 
        lstReport.RowSource = "qryFilterResults" 
        lstReport.ColumnCount = lstfield.ListCount 
        lstReport.RowSource = lstApp.Value 
    End If 
End Sub 

If you like these VB formatting tags please consider sponsoring the author in support of injured Royal Marines
And here is the code that builds the query.

    Dim db As DAO.Database 
    Dim qdf As DAO.QueryDef 
    Dim strSQL As String 
    Dim frm As Form, ctl As Control, ctl2 As Control 
    Dim varItm As Variant, intI As Integer 
    Dim strbuild As String 
    Set db = Application.CurrentDb 
    Set qdf = db.QueryDefs("qryFilterResults") 
    Set frm = Forms!Switchboard 
    Set ctl = frm!lstfield 
    Set ctl2 = frm!lstApp 
    strbuild = "" 
    For Each varItm In ctl.ItemsSelected 
        For intI = 0 To ctl.ColumnCount - 1 
            If strbuild


I am trying to populate the first 12 columns in the last row of the active sheet from 12 UserForm TextBoxes (TB5 thru TB16). Here is the code:

    For i = 1 To 12 
        .Offset(0, i - 1).Value = Me.Controls("TB" & i + 4).Value 
        MsgBox "Cycle " & i 
    Next i 
End With 

If you like these VB formatting tags please consider sponsoring the author in support of injured Royal Marines
The MsgBox returns a "Cycle 13" only once. The Row has the first column filled but none of the rest. I am trying to load TB5 thru TB16 into columns A thru L of the last row (the last row was copied down to get the formatting and this code was supposed to over write the copied data and leave the formatting). But only TB5 loads into Column A!!!

Anyone see anything wrong with this code?

Or if anyone has any sugestions as to how to make it work?

Any help is greatly appreciated.


I am trying to change the control source of a textbox...i have tried the following code, without any luck:

txtOperations.ControlSource = Sheets("Severity Data").Range("G6")

The contents of G6 is very long ( ~200-500 characters), should I maybe store the string of text in a file instead of a cell, then copy it to the text box.
If anyone has any suggestions, it would be greatly appreciated!!!

Is there any way to print the contents of a message box? If not, how can you print the contents of a Variable that contains all the data of said message box?

Macro recorder isn't much help on this one.

I need to print the contents of either the box, or the variable Z from the following:

Sub CheckOverdue()
Dim x As Range
Dim y As String
Dim z As String
y = "PEOPLE CURRENTLY OVERDUE FOR Training" & vbNewLine & vbNewLine
For Each x In Worksheets("Training").Range("OverdueCheck ")
If x.Value = "OVERDUE!" Then
y = y & x.Offset(0, -3).Value & " was due on " & x.Offset(0, -1).Value & vbNewLine
End If
Next x
MsgBox ("Everyone is Current")
z = y & vbNewLine & vbNewLine & "They should be Scheduled as soon as possible"
MsgBox (z)
End If
End Sub


No luck finding an answer? You could always try Google.