Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 33
Default Import from spreadsheet

I have a userform with a spreadsheet on. I want to populate it with data from
an other sheet in a workbook. Can someone help, please

Regards

kjeldc
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 33
Default Import from spreadsheet

Thanks sebastienm. Perfect. But also a little curius! I tryed the code in
Form_Initialize, that did not work. Can you tell me why?

"sebastienm" skrev:

Hi,
By 'a sheet on the userform' , do you mean a Microsoft Office SpreadSheet
control (Office Web Components) ?
If so, assuming your userform's sheet is Spreadsheet1 and assuming you have
a command button Commandbutton1:

' fill the sheet on userform from workbook data
Private Sub CommandButton1_Click()

'Eg1: by setting the range value
Spreadsheet1.Range("A1") = ThisWorkbook.Worksheets(1).Range("A1")

'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

--
Regards,
Sébastien
<http://www.ondemandanalysis.com


"Kjeldc" wrote:

I have a userform with a spreadsheet on. I want to populate it with data from
an other sheet in a workbook. Can someone help, please

Regards

kjeldc

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 181
Default Import from spreadsheet

This is not working for me... I got an error on the
Spreadsheet1.Range("A1").Paste

any idea why?

I have Excel 2002 SP3
my userform spreadsheet is Microsoft Office Spreadsheet 9.0

"sebastienm" wrote:

Hi,
By 'a sheet on the userform' , do you mean a Microsoft Office SpreadSheet
control (Office Web Components) ?
If so, assuming your userform's sheet is Spreadsheet1 and assuming you have
a command button Commandbutton1:

' fill the sheet on userform from workbook data
Private Sub CommandButton1_Click()

'Eg1: by setting the range value
Spreadsheet1.Range("A1") = ThisWorkbook.Worksheets(1).Range("A1")

'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

--
Regards,
Sébastien
<http://www.ondemandanalysis.com


"Kjeldc" wrote:

I have a userform with a spreadsheet on. I want to populate it with data from
an other sheet in a workbook. Can someone help, please

Regards

kjeldc

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7,247
Default Import from spreadsheet


This is not working for me... I got an error on the
Spreadsheet1.Range("A1").Paste


What is "Spreadsheet1"? What error do you get? As written,
Spreadsheet1 must be a variable typed Worksheet and then Set to a
particular worksheet. E.g,

Dim SpreadSheet1 As Worksheet
Set SpreadSheet1 = ThisWorkbook.Worksheets("Sheet1")

Cordially,
Chip Pearson
Microsoft MVP 1998 - 2010
Pearson Software Consulting, LLC
www.cpearson.com
[email on web site]





On Sat, 6 Feb 2010 11:37:01 -0800, Alberto Ast
wrote:

This is not working for me... I got an error on the
Spreadsheet1.Range("A1").Paste

any idea why?

I have Excel 2002 SP3
my userform spreadsheet is Microsoft Office Spreadsheet 9.0

"sebastienm" wrote:

Hi,
By 'a sheet on the userform' , do you mean a Microsoft Office SpreadSheet
control (Office Web Components) ?
If so, assuming your userform's sheet is Spreadsheet1 and assuming you have
a command button Commandbutton1:

' fill the sheet on userform from workbook data
Private Sub CommandButton1_Click()

'Eg1: by setting the range value
Spreadsheet1.Range("A1") = ThisWorkbook.Worksheets(1).Range("A1")

'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

--
Regards,
Sébastien
<http://www.ondemandanalysis.com


"Kjeldc" wrote:

I have a userform with a spreadsheet on. I want to populate it with data from
an other sheet in a workbook. Can someone help, please

Regards

kjeldc

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 181
Default Import from spreadsheet

Chip,

Thanks for your replay.... spreadsheet1 is a spreadysheet within a user
form...
Below reply from Sebastien back in 2006 kind of answer what I needed but
I got the error so it does not work as stated initially...
I want to paste data from a worksheet into a spreadsheet in a user form
so I can see some data with in my user form.


"Chip Pearson" wrote:


This is not working for me... I got an error on the
Spreadsheet1.Range("A1").Paste


What is "Spreadsheet1"? What error do you get? As written,
Spreadsheet1 must be a variable typed Worksheet and then Set to a
particular worksheet. E.g,

Dim SpreadSheet1 As Worksheet
Set SpreadSheet1 = ThisWorkbook.Worksheets("Sheet1")

Cordially,
Chip Pearson
Microsoft MVP 1998 - 2010
Pearson Software Consulting, LLC
www.cpearson.com
[email on web site]





On Sat, 6 Feb 2010 11:37:01 -0800, Alberto Ast
wrote:

This is not working for me... I got an error on the
Spreadsheet1.Range("A1").Paste

any idea why?

I have Excel 2002 SP3
my userform spreadsheet is Microsoft Office Spreadsheet 9.0

"sebastienm" wrote:

Hi,
By 'a sheet on the userform' , do you mean a Microsoft Office SpreadSheet
control (Office Web Components) ?
If so, assuming your userform's sheet is Spreadsheet1 and assuming you have
a command button Commandbutton1:

' fill the sheet on userform from workbook data
Private Sub CommandButton1_Click()

'Eg1: by setting the range value
Spreadsheet1.Range("A1") = ThisWorkbook.Worksheets(1).Range("A1")

'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

--
Regards,
Sébastien
<http://www.ondemandanalysis.com


"Kjeldc" wrote:

I have a userform with a spreadsheet on. I want to populate it with data from
an other sheet in a workbook. Can someone help, please

Regards

kjeldc

.

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Import Spreadsheet into Access Jon Excel Worksheet Functions 1 May 30th 08 02:33 PM
How can I import our logo into a spreadsheet? Pam Excel Discussion (Misc queries) 1 November 22nd 06 11:39 PM
Import from spreadsheet sebastienm Excel Programming 0 March 26th 06 11:44 PM
Import data to a spreadsheet. Bethany L Excel Discussion (Misc queries) 1 February 3rd 06 05:04 PM
Import a spreadsheet Spencer Hutton[_3_] Excel Programming 3 December 21st 04 02:28 PM


All times are GMT +1. The time now is 06:55 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"