PDA

View Full Version : spreadsheet 10 control



ProteanBeing
02-02-2008, 11:17 AM
I put a spreadsheet control into a userform. How do I move data into it using VBA code?

qff
02-03-2008, 02:02 AM
Hi

this is one way you could do it

Private Sub UserForm_Initialize()
Spreadsheet1.Sheets(1).Select
Dim myrow As Long
Dim mycol As Integer
For myrow = 1 To 5
For mycol = 1 To 7
Spreadsheet1.Cells(myrow, mycol).Value = Sheet1.Cells(myrow, mycol).Value
Next mycol
Next myrow
End Sub