+ Reply to Thread
Results 1 to 2 of 2

Change Active Cell but not it's relative position

  1. #1
    Registered User
    Join Date
    05-15-2008
    Posts
    6

    Change Active Cell but not it's relative position

    Hello: I'm writing a macro in Excel 2003 to search a spreadsheet that is approximately 100 columns by 100 rows. I have successfully written VBA code to find the single cell identified by user input of Name and location. Let's say it was found in Col Z row 26. My macro correctly scrolls the spreadsheet horizontally and vertically so that cell Z26 appears as the first unfrozen cell. B2 is the first unfrozen because, I have frozen the locations in row 1 and the names in column A so the first unfrozen cell location is B2. When I try to make cell Z26 the active cell in that location, the sheet rolls back the scrolling and makes B2 the active cell.

    How can I keep cell Z26 in the position I scrolled it to and make it the active cell so the user's key strokes can enter information there?

    ...A B C D E F .....................................................Z
    1
    2...... X<-- I can scroll it to here but I can make it active without unscrolling.
    3
    4
    5
    6
    7
    .
    .
    .
    26................................................................. X<-- The macro found this Cell correctly.

    Any and all help is appreciated. I've read about using offsets to do something like this but I'm not getting anywhere with that.

    John

  2. #2
    Forum Expert romperstomper's Avatar
    Join Date
    08-13-2008
    Location
    England
    MS-Off Ver
    365, varying versions/builds
    Posts
    21,898

    Re: Change Active Cell but not it's relative position

    You can use Goto for that:
    Please Login or Register  to view this content.
    for example.
    Everyone who confuses correlation and causation ends up dead.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1