Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Wanet Telecoms Ltd on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Show range of excel cells on a userform

Status
Not open for further replies.

DrSmyth

Technical User
Jul 16, 2003
557
GB
This is quite an odd thing that i'm trying to do so not sure if it's possible.

Is it possible to view a range from an excel worksheet on a userform?

Basically, I've got a team of people that use a userform to do a variety of tasks with excel from logging calls to adding events to a diary, this works quite well and they are used to using the userform. However currently they have to hide the userform and then select the relevant page of a workbook to be able to view a diary (basically there are about 8 or 9 diaries which consist of a range of multi color cells and some text)

So what i wanted to do was enable them to view a diary on the userform. Can anybody help?

 
Select the following..

in VBEditor [Tools]..[References]..

Ensure Microsoft Excel 9.0 Object Library is selected.

[OK]

then [Tools]..[Additional Controls]..

Ensure Microsoft Office Spreadsheet 9.0 is selected.

Insert the Spreadsheet into the Form.

Paste and manipulate the following code to do what you want.

Assuming..
Range A1 is the top left of the data.
Userform is called Userform1
Userform1 Embedded Spreadsheet is called Spreadsheet1


Sub Macro4()
Range("A1").Select
Range(Selection, ActiveCell.SpecialCells(xlLastCell)).Select
Selection.Copy

With UserForm1.Spreadsheet1
.Cells(1, 1).Paste

End With
UserForm1.Show
End Sub

It's a start!


crazy times call for crazy people


CrazyPabs


sometimes I wonder why I even bova...
 
Cheers,

I'll give it a go....

Dr
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top