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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

zooming into cells

Status
Not open for further replies.

RamziSaab

MIS
May 7, 2003
522
GB
i dont know if this is possible but:

Is there a way using code or something else...to zoom into cells that are selected...ie. like a magnifying glass on the selection..
 
RamziSaab, I'm not I understand what you are trying to do. Do you want to zoom in the whole sheet or just the individual cell. If the latter, its probably best to have a shape of some sort and copy the text into it and make it visible/hidden when required using the SelectionChange event.

Allan
 
THank for your help, what i did was build a form in vba and on double click event it will populate the target cells and the cells adjacent to them..

 
Not sure if this is what you mean, but you can customize a tool bar by adding the "Camera" icon (See Tools category on the Commands tab).

With the "camera" you can take a "picture" of the currently selected cells and then park the picture anywhere on the sheet. You can then grab a picture handle and drag it to make the picture as large (or small) as you want.

The nice thing is, the picture isn't static. If you change the cell contents, the picture is updated too.

I'm currently using Excel 97.

 
Zathras, that was pretty much what i was trying to do...but i think the form i did will be more flexible as i am going to allow the user to scroll through the cells using the form too...thanks for that though i am sure iwill use it in the future
 
I have a scroll button on the form that i made...up and down

Is there a way to make it run the macro when i press the up or down button?? (or page up and page down)
 
Trap the Change event and then call your macro:
[blue]
Code:
Option Explicit

Private Sub ScrollBar1_Change()
  MsgBox "Change - Value: " & ScrollBar1.Value
End Sub

Private Sub ScrollBar1_Scroll()
  TextBox1.Value = ScrollBar1.Value
End Sub
[/color]

 
Sorry how do i trap the event of someone pressing the down key...
 
Double-click on the scroll bar when in design mode. That will open the code page for the form with a code stub already begun for you.

Assuming you have a macro already written (and entered on a separate code module page), just insert a line of code between the Sub and End Sub lines, something like this:
[blue]
Code:
Option Explicit

Private Sub ScrollBar1_Change()
  Call ProcessNewScrollPosition(ScrollBar1.Value)
End Sub
[/color]

(Sample code for demo - in a code module:)
[blue]
Code:
Option Explicit

Sub ProcessNewScrollPosition(NewScrollPosition As Long)
  MsgBox "User has scrolled to position " & NewScrollPosition
End Sub
[/color]

You should set some scroll bar properties. At the very least, set LargeChange, SmallChange, Min and Max.
Before showing the form, you want to set Min=1 and Max=(LastRow of the sheet). You could leave SmallChange at 1, but set LargeChange to the number of visible lines from the sheet so that the movement will be what the user expects.

 
sorry should have made my selfclear the scroll bar only seems to give values from 0 upwards so i made my own scroll up and scroll down buttons (not a scrolls button or a spin button) just seperate command buttons.

Is there a way to assign the page up and page down key to them
 
Ramzi
Just a little side issue here - As Zathras has pointed out you can set the min & max properties of a scroll bar to whatever you want, so it doesn't have to start at 0.

;-)

If a man says something and there are no women there to hear him, is he still wrong? [ponder]
The faqs ma'am, just the faqs. Get the best from these forums : faq222-2244
 

...i made my own scroll up and scroll down buttons...
Why not use a scroll bar? Most users already know how to use them. Designing a non-standard interface will only lead to confusion.

...the scroll bar only seems to give values from 0 upwards...
Set the Min and Max properties.

...Is there a way to assign the page up and page down key...
You can trap the page keys with the KeyUp event:
[blue]
Code:
Private Sub ScrollBar1_KeyUp(ByVal KeyCode As MSForms.ReturnInteger, ByVal Shift As Integer)
  MsgBox KeyCode & " " & Shift
End Sub
[/color]


 
thanks (just remember its friday afternoon here)will giev it a try on monday.

thanks again
 
Why not just pick "Selection" from the zoom combo? As Zathras pointed out, customised interfaces cause confusion.
 
RamziSaab, with ActiveWindow.Zoom = True you can fit selection to window. The zoom ratio will be between 10% and 400%

combo
 
Thanks everyone for there help built the custome form (cause i needed a few more functions then the zoom.) it works perfectly and extremely simple to use!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top