need help with form textbox to equal worksheet.range

G

GregJG

I am trying to get a

multipage1.pages(1).textbox1

to show all the text in all the cells of an

activeworkbook.worksheets("sheet2")

this is one of many variants I have tried.

Me.MultiPage1.Pages(1).TextBox1.Value
Worksheets("sheet2").Range("A1:N80")
Me.MultiPage1.Pages(1).SetFocus

I cannot seem to get any results. could anyone help?

thanks
 
J

JE McGimpsey

One way:

Dim rCell As Range
Dim sText As String

For Each rCell In ActiveWorkbook.Sheets("Sheet2").Range("A1:N80")
If Not IsEmpty(rCell.Value) Then _
sText = sText & rCell.Text
Next rCell
With Me.MultiPage1.Pages(1)
.TextBox1.Value = sText
.SetFocus
End With
 
G

GregJG

thanks JE

your code has gotten me closer to what I want as a final result.

but, it places them all on one row. I am trying to get the textbox t
look exactly like the worksheet.

i have tried working with MS knowledgebase, but most of there answer
are too vague for a beginner like me.

I have tried using the print preview in VBA but my excel 2003, w2kpro,
freezes everytime. from what I gather it has to do with the form bein
open, but i don't want the form to close.

the form is a multipage. I figured i could use multipage1.pages(0) t
fill cells onto a worksheet, then copy the whole worksheet t
multipage1.pages(1).textbox1

any input anyone has on a better way would be greatly appreciated
 
Top