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

Preventing scrolling

Status
Not open for further replies.

BigInch

Petroleum
Joined
Jun 21, 2006
Messages
15,161
Location
GB
I'm writing an Excel app to find the area of a polygon pasted into a picture box. I move the cursor over a point and press the spacebar which sends the coordinates to a couple of cells. This works great until I get too many points and XL starts scrolling! As the coordinates are screen relative, its not good to have the picture scrolling around. Can I somehow prevent scrolling until I'm finished capturing all my points?

"We have a leadership style that is too directive and doesn't listen sufficiently well. The top of the organisation doesn't listen sufficiently to what the bottom is saying." Tony Hayward CEO BP
"Being GREEN isn't easy." Kermit[frog]
 
Have you tried using the Freeze Panes function?
 
Freezing may do what you want if the area of interest is in the frozen portion of screen.

Another possibility:
Sub LIMITSCROLL()
Dim mysheet As Worksheet
Set mysheet = Sheets("Sheet1")
mysheet.ScrollArea = "A1:R32"
End Sub

=====================================
Eng-tips forums: The best place on the web for engineering discussions.
 
Open the VBA editor and modify the ScrollArea for the sheet.

[link ]
btn_liprofile_blue_80x15.gif" width="80" height="15" border="0" alt="View Clyde's profile on LinkedIn
[/url]
 
BigInch - you can download a spreadsheet that does what you are looking for from here:


Rather than using mouse clicks you draw a polygon over the shape, and the program uses the coordinates of the polygon vertices, which gets around the scrolling problem.

The code is all open source, so it may give you some ideas, even if it isn't suitable for your application as is.

Doug Jenkins
Interactive Design Services
 
ePete, I realized that if I didn't print the values in any cells and just calculated the area as a part of the VBA program itself, scrolling didn't happen, so the problem kinda' went away there, but thanks. I'm sure I'll run into the scrolling problem again somewhere.

Clyde, where is that feature. I can't find it.

Doug, I'll try your digitizing program. Sounds like that will do exactly what I want. Wish I knew about that yesterday, but then I wouldn't have gotten all that good DIY education. :-\

Super. Thanks all.

"We have a leadership style that is too directive and doesn't listen sufficiently well. The top of the organisation doesn't listen sufficiently to what the bottom is saying." Tony Hayward CEO BP
"Being GREEN isn't easy." Kermit[frog]
 
Ah ha. Properties page. Never noticed scroll area was there.

"We have a leadership style that is too directive and doesn't listen sufficiently well. The top of the organisation doesn't listen sufficiently to what the bottom is saying." Tony Hayward CEO BP
"Being GREEN isn't easy." Kermit[frog]
 
Probably

application.screenupdating = false

would do the trick.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top