Working With A New Window in Excel

jim may

Well-known Member
Joined
Jul 4, 2004
Messages
7,486
What I've been trying to do might not be possible, but I'll ask anyway...

In my File on a Given Worksheet named "Main" - I clicked on View - New Window

So Now I have MyFileName.xlsm:1 and also (now, not before) MyFileName.xlsm:2.

Originally on my Main Sheet (Now +":1")- I had Sheet1, Sheet2 and Sheet3 and still in my
Now + ":2" window I have the same 3 Sheets, No Surprises so far...

MY Question..

In my ":1" Window Can I hide Sheet1 and Sheet3 - So that ONLY Sheet2 is Showing?

AND ALSO

In my ":2" Window Can I hide Sheet1 and Sheet2 - So that ONLY Sheet3 is Showing?

:confused::confused::confused:

I'm trying to do this ALL in Code.

Thanks in advance.

Jim
 
Last edited:

Excel Facts

Shade all formula cells
To shade all formula cells: Home, Find & Select, Formulas to select all formulas. Then apply a light fill color.
I do not think the same workbook can have a dual personality like that!
- close your left eye and look in the mirror and then open both eyes in your reflection leaving the physical left closed! :confused:

- try doing it without VBA (Excel does not allow it)

perhaps...
Create a temporary copy of the file
- and refresh as required

or ...
If you simply want to view some cells you could use the camera tool
- data in the pictures is dynamic
- if a large sheet could have multiple viewable "pictures"
- automate with VBA if lots of changing "photo requests"
etc
 
Last edited:
Upvote 0
A dynamic picture which follows the cursor
- and it takes less than 1 minute to set up and test!

1, Open a new workbook and add Sheet2

2. place this formula in cell A1 in Sheet2
=ADDRESS(ROW(),COLUMN(),4)

3. drag across to column N and down to row 200 - those cells now contain their own address

4. place code below in SHEET module of Sheet1

5. go back to Excel and click on cell A12 in Sheet1

6. click on cell A13 etc

7. scroll to cell A60 and click on it etc


place code below in SHEET module of Sheet1
Code:
[COLOR=#006400]Private Sub Worksheet_SelectionChange(ByVal Target As Range)[/COLOR][I][COLOR=#006400][/COLOR][/I]
    If Target.Count = 1 Then FollowMe
[COLOR=#006400][I]End Sub[/I][/COLOR]

[COLOR=#006400]Private Sub FollowMe()[/COLOR]
    Const pic = "Sheet2_Selfie"
    Dim r As Long, rng As Range, cel As Range
BurnPreviousShot:
    On Error Resume Next
    ActiveSheet.Shapes(pic).Delete
SheetSelfie:
    r = ActiveCell.Row
    Set rng = Sheets("Sheet2").Cells(r, 1).Resize(10, 14)
    rng.CopyPicture
DevelopAndPrint:
    Set cel = ActiveWindow.VisibleRange(2, 2)
    On Error GoTo 0
    On Error GoTo Handler
    Application.EnableEvents = False
    cel.PasteSpecial
NameAndPlace:
    With Me.Shapes(Me.Shapes.Count)
        .Name = pic
        .Left = cel.Left
        .Top = cel.Top
    End With
Handler:
Application.EnableEvents = True
[COLOR=#006400]End Sub[/COLOR]
 
Last edited:
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,175
Members
453,021
Latest member
Justyna P

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top