Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35
Default view one worksheet from within another workbook

Hi

Is there anyway I can view the contents of one worksheet of one workbook in
a seperate worksheet in a different workbook.

Thanks

Wendy


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 274
Default view one worksheet from within another workbook

Hi Wendy,

I suspect that this relates to your earlier post and that what you
really want to do is to prompt the user to select a row / record to
import from a 'source' workbook into the 'active' workbook.

The only way l can think of achieving this is to use the 'Window'
'Arrange' options, perhaps say placing the 'active' workbook on the
left and the 'source' workbook on the right with the window sized
smaller. This would achieve the visual impact required and allow the
row / record selection in the 'source' workbook.

Whilst writing l am thinking perhaps using the 'Window' 'Arrange'
'Cascade' option and resizing the 'source' window smaller may be a
visually better option. The 'source' window could open in the middle
of the 'active' window following a prompt to select the row / record.

If l am wrong in my original assumption and you only want to take a
'snapshot' of a particular sheet or sheet range look at the 'camera'
function. This will not provide any interactivity.

HTH

Regards

Michael

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 80
Default view one worksheet from within another workbook


"michael.beckinsale" wrote in message
...
Hi Wendy,

I suspect that this relates to your earlier post and that what you
really want to do is to prompt the user to select a row / record to
import from a 'source' workbook into the 'active' workbook.

The only way l can think of achieving this is to use the 'Window'
'Arrange' options, perhaps say placing the 'active' workbook on the
left and the 'source' workbook on the right with the window sized
smaller. This would achieve the visual impact required and allow the
row / record selection in the 'source' workbook.

Whilst writing l am thinking perhaps using the 'Window' 'Arrange'
'Cascade' option and resizing the 'source' window smaller may be a
visually better option. The 'source' window could open in the middle
of the 'active' window following a prompt to select the row / record.

If l am wrong in my original assumption and you only want to take a
'snapshot' of a particular sheet or sheet range look at the 'camera'
function. This will not provide any interactivity.

HTH

Regards

Michael



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 789
Default view one worksheet from within another workbook

Hi
From earlier post you wanted to view the data in a workbook called
Post.xls.
The code below assumes post is in D:\Temp and has a worksheet on it
called Data. Change these as required. Attach the
DisplayIt macro to a button in your other workbook. Put the dispayIt
macro and the function below into a code module.
The Post.xls can be open or closed.
Is this what you want to see?

Sub DisplayIt()
Dim PostWorkbook As Workbook
If IsFileOpen("Post.xls") Then
Workbooks("Post").Worksheets("Data").Activate
Else
Set PostWorkbook = Workbooks.Open(filename:="D:\Temp\Post.xls")
ActiveWorkbook.Worksheets("Data").Activate
End If
ThisWorkbook.Activate
Windows.CompareSideBySideWith "post"
End Sub

Function IsFileOpen(filename As String)
Dim filenum As Integer, errnum As Integer
Err.Clear
On Error Resume Next ' Turn error checking off.
filenum = FreeFile() ' Get a free file number.
' Attempt to open the file and lock it.
Open filename For Input Lock Read As #filenum
Close filenum ' Close the file.
errnum = Err ' Save the error number that occurred.
On Error GoTo 0 ' Turn error checking back on.

' Check to see which error occurred.
Select Case errnum
' No error occurred.
' File is NOT already open by another user.
Case 0
IsFileOpen = False
' Error number for "Permission Denied."
' File is already opened by another user.
Case 70
IsFileOpen = True
' Another error occurred.
Case Else
IsFileOpen = False
End Select
End Function


regards
Paul

On Feb 27, 10:44*am, "Wendy" wrote:
Hi

Is there anyway I can view the contents of one worksheet of one workbook in
a seperate worksheet in a different workbook.

Thanks

Wendy


  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 274
Default view one worksheet from within another workbook

Hi Paul,

It seems we were both thinking along the same lines!

Regards

Michael



  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35
Default view one worksheet from within another workbook

Hi

Thanks for this, I'm thinking more along the lines of showing the data in
text box, list box or listview rather than displaying the whole
spreadsheet. I only need to see data in columns A,B & C.

Wendy

wrote in message
...
Hi
From earlier post you wanted to view the data in a workbook called
Post.xls.
The code below assumes post is in D:\Temp and has a worksheet on it
called Data. Change these as required. Attach the
DisplayIt macro to a button in your other workbook. Put the dispayIt
macro and the function below into a code module.
The Post.xls can be open or closed.
Is this what you want to see?

Sub DisplayIt()
Dim PostWorkbook As Workbook
If IsFileOpen("Post.xls") Then
Workbooks("Post").Worksheets("Data").Activate
Else
Set PostWorkbook = Workbooks.Open(filename:="D:\Temp\Post.xls")
ActiveWorkbook.Worksheets("Data").Activate
End If
ThisWorkbook.Activate
Windows.CompareSideBySideWith "post"
End Sub

Function IsFileOpen(filename As String)
Dim filenum As Integer, errnum As Integer
Err.Clear
On Error Resume Next ' Turn error checking off.
filenum = FreeFile() ' Get a free file number.
' Attempt to open the file and lock it.
Open filename For Input Lock Read As #filenum
Close filenum ' Close the file.
errnum = Err ' Save the error number that occurred.
On Error GoTo 0 ' Turn error checking back on.

' Check to see which error occurred.
Select Case errnum
' No error occurred.
' File is NOT already open by another user.
Case 0
IsFileOpen = False
' Error number for "Permission Denied."
' File is already opened by another user.
Case 70
IsFileOpen = True
' Another error occurred.
Case Else
IsFileOpen = False
End Select
End Function


regards
Paul

On Feb 27, 10:44 am, "Wendy" wrote:
Hi

Is there anyway I can view the contents of one worksheet of one workbook
in
a seperate worksheet in a different workbook.

Thanks

Wendy



  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 274
Default view one worksheet from within another workbook

Hi Wendy,

If you want to use the control box 'ListBox' form then simply apply
something like this to its properties:

ListFillRange: '[post]Data'!$A$1:$C$3
ColumnCount: 3

This will display the contents of all 3 columns in a tabular format.

Apply other properties / code as required.

Regards

Michael
  #8   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 789
Default view one worksheet from within another workbook

Hi Wendy
Try to say what it is you really want, as I suggested in your earlier
posts.
regards
Paul

On Feb 27, 12:52*pm, "Wendy" wrote:
Hi

Thanks for this, I'm thinking more along the lines of showing the data in
text box, list box or *listview rather than displaying the whole
spreadsheet. *I only need to see data *in columns A,B & C.

Wendy

wrote in message

...
Hi
From earlier post you wanted to view the data in a workbook called
Post.xls.
The code below assumes post is in D:\Temp and has a worksheet on it
called Data. Change these as required. Attach the
DisplayIt macro to a button in your other workbook. Put the dispayIt
macro and the function below into a code module.
The Post.xls can be open or closed.
Is this what you want to see?

Sub DisplayIt()
Dim PostWorkbook As Workbook
* *If IsFileOpen("Post.xls") Then
* * Workbooks("Post").Worksheets("Data").Activate
* *Else
* * Set PostWorkbook = Workbooks.Open(filename:="D:\Temp\Post.xls")
* * ActiveWorkbook.Worksheets("Data").Activate
* *End If
* * ThisWorkbook.Activate
* * Windows.CompareSideBySideWith "post"
End Sub

Function IsFileOpen(filename As String)
* * Dim filenum As Integer, errnum As Integer
* * Err.Clear
* * On Error Resume Next * ' Turn error checking off.
* * filenum = FreeFile() * ' Get a free file number.
* * ' Attempt to open the file and lock it.
* * Open filename For Input Lock Read As #filenum
* * Close filenum * * * * *' Close the file.
* * errnum = Err * * * * * ' Save the error number that occurred.
* * On Error GoTo 0 * * * *' Turn error checking back on.

* * ' Check to see which error occurred.
* * Select Case errnum
* * * * ' No error occurred.
* * * * ' File is NOT already open by another user.
* * * * Case 0
* * * * * * IsFileOpen = False
* * * * ' Error number for "Permission Denied."
* * * * ' File is already opened by another user.
* * * * Case 70
* * * * * * IsFileOpen = True
* * * * ' Another error occurred.
* * * * Case Else
* * * * * * IsFileOpen = False
* * End Select
End Function

regards
Paul

On Feb 27, 10:44 am, "Wendy" wrote:



Hi


Is there anyway I can view the contents of one worksheet of one workbook
in
a seperate worksheet in a different workbook.


Thanks


Wendy- Hide quoted text -


- Show quoted text -


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
Change from userform view to excel workbook view SEWarren Excel Programming 1 September 6th 07 02:18 AM
Can't view Workbook galantgirl79 Excel Discussion (Misc queries) 3 April 20th 07 08:57 PM
How to view a custom view when the worksheet is protected? JulesJam Excel Worksheet Functions 0 March 6th 06 02:15 PM
Can I view multiple tabbed worksheet in the same workbook in Excel bdc2000 Excel Discussion (Misc queries) 1 December 5th 05 03:51 PM
Possible to view more than one worksheet in same workbook?? Marcello do Guzman[_3_] Excel Programming 1 December 18th 04 10:56 PM


All times are GMT +1. The time now is 08:19 PM.

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

About Us

"It's about Microsoft Excel"