View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Alberto Ast[_2_] Alberto Ast[_2_] is offline
external usenet poster
 
Posts: 181
Default paste data from a workbook on a userform spreadsheet

I tried the following I pull from an old post I found

Private Sub CommandButton1_Click()

'Eg2: by copyoing from the source workbook and pasting to the
' spreadsheet on the userform
ThisWorkbook.Worksheets(1).Range("A1:a10").Copy
Spreadsheet1.Range("A1").Paste

End Sub

but my macro fail on the last line... Jusst to test I tried to replace

Spreadsheet1.Range("A1").Paste by Spreadsheet1.Range("A1").Select

but if fail same way.. I can not access my userform screadsheet to populate
it.
I post a similar question yesterday but I does not show on my posts so I do
not know if somebody saw it.

I tried following too which I got in a previous post but fail too

Set Dest = UserForm1.Spreadsheet1.Range("a1") <----- FAILS HERE
Sheets("sheet1").Range("A1:B2").Copy
Dest.Paste

Hope I can get some help.... I have spend few days into this with no luck.