OzGrid

How to find last non blank cell & not affect split screen view

< Back to Search results

 Category: [Excel]  Demo Available 

How to find last non blank cell & not affect split screen view

 

Requirement:

 

The user has a worksheet that has a split screen view & code to find the last non blank cell.

Code:
Private Sub Worksheet_Activate()
Range("C329").End(xlUp).Select
End Sub

When the last non blank cell is found, it shows on both the top & bottom screen. Is it possible to have it show only in the top portion of the split.

 

Solution:

 

Code:
Option Explicit

Private Sub Worksheet_Activate()
' As long As Split Mode is already on
 ActiveWindow.Panes(1).Activate
  Range("C329").End(xlUp).Select
  ActiveCell.Offset(1).Select
End Sub

 

By selecting Panes(1) you are activating the pane in the upper-left corner of the active window.

 

Obtained from the OzGrid Help Forum.

Solution provided by Carim and FrankM.

 

See also: Index to Excel VBA Code and Index to Excel Freebies and Lesson 1 - Excel Fundamentals and Index to how to… providing a range of solutions and Index to new resources and reference sheets

 

See also:

How to compare two columns in excel, inserting blank rows moving associated data
How to end a macro if cell blank or continue if populated
How to auto populate blank cells using VBA
How to remove blank lines from word document generated using Excel
How to copy non-blank rows in a range and paste to other sheets

 

Click here to visit our Free 24/7 Excel/VBA Help Forum where there are thousands of posts you can get information from, or you can join the Forum and post your own questions.


Gallery



stars (0 Reviews)