LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 270
Default Capture Screen Position

Have code (see below) where if user enters something in Cell O68, it puts the
same value in D21 and forces the cursor to remain at Cell O68 after cell
entry (in case they want to enter something else). The problem is that only
specific cells in the sheet are unlocked, so when the user enters a value in
O68, Excel goes to the next unlocked cell (which is A3) then back to O68 (the
target). This causes the screen position to move slightly; i.e., if the top
row before entry is 65, after the code runs, it always moves the screen so
the top row is 47. I need the screen to stay in the same spot. Have tried
all manner of screen updating = false and also changing the code so that
after entry the cursor doesn't move, but it still affects the screen
position. It's not that the screen is moving back and forth (as when screen
updating is true), but only that it is adjusting the scroll position
so-to-speak.

Can someone advise me what I'm doing wrong, or if there is a way to capture
the specific position of the screen before entry, so I can then return the
user to that spot after entry?

Private Sub Worksheet_Change(ByVal Target As Range)
If Not Application.Intersect(Target, Range("O68")) Is Nothing Then
Range("D21").Value = Range("O68").Value
Target.Select
End If
End Sub
 
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
Excel screen capture to capture cells and row and column headings jayray Excel Discussion (Misc queries) 5 November 2nd 07 11:01 PM
Position of CellCursor on Screen (absolute position) [email protected] Excel Programming 1 November 23rd 05 02:23 AM
Need Help! VBA screen capture question Jon Peltier[_8_] Excel Programming 0 July 29th 04 11:40 PM
How to capture screen through VBA? Bill Choy[_2_] Excel Programming 3 July 23rd 04 05:00 AM
Capture mouses X &Y position on a worksheet Stewart[_3_] Excel Programming 2 May 6th 04 06:37 PM


All times are GMT +1. The time now is 09:26 AM.

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"