Hey Doug etal,
I’m running your code to highlight the column B cell based on the active row (see code below). It’s doing just what I want and for that I thank you.
I also have a macro that assists in printing (PrintLoanInfo – see below). I created this using Excel’s macro recorder. For the most part, this too is doing what I want. However, I just noticed a little anomaly. The “highlight” routine works perfect until the print macro is run. Once PrintLoanInfo is run up or down cursor/arrow movement slows down. There is a considerable lag after each arrow up or down (left-right works fine).
As I noted before, I am no programmer so please bear with me. As a test I remarked out some lines in my print macro. What I found was if any “Active” process (ActiveSheet or ActiveWindow) is included the slowdown happens. If I exclude all three “active” lines there is no slowdown (the print macro fails but that’s to be expected). If I included just one active process it slows down.
My question – what is Active.xxx doing and is it possible to “deactivate” such processes?
Here are the two routines:
Any suggestions would be greatly appreciated.
Thanks,
Steve
Split from
https://www.mrexcel.com/forum/excel-questions/1089413-highlight-cell-based-position-active-cell.html
I’m running your code to highlight the column B cell based on the active row (see code below). It’s doing just what I want and for that I thank you.
I also have a macro that assists in printing (PrintLoanInfo – see below). I created this using Excel’s macro recorder. For the most part, this too is doing what I want. However, I just noticed a little anomaly. The “highlight” routine works perfect until the print macro is run. Once PrintLoanInfo is run up or down cursor/arrow movement slows down. There is a considerable lag after each arrow up or down (left-right works fine).
As I noted before, I am no programmer so please bear with me. As a test I remarked out some lines in my print macro. What I found was if any “Active” process (ActiveSheet or ActiveWindow) is included the slowdown happens. If I exclude all three “active” lines there is no slowdown (the print macro fails but that’s to be expected). If I included just one active process it slows down.
My question – what is Active.xxx doing and is it possible to “deactivate” such processes?
Here are the two routines:
Code:
===== Highlight Code =============================
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Not Intersect(Target, Range("A32:K1500")) Is Nothing Then
With Sheet1.Range("C32:C1500").Font
.Bold = False
.Size = 8
.ColorIndex = 0
End With
With Sheet1.Range("C" & Target.Row).Font
.Bold = True
.Size = 8
.ColorIndex = 3
End With
End If
End Sub
========================================================
===== Print Macro =======================================
Sub PrintLoanInfo()
Range("B2:K26").Select
ActiveSheet.PageSetup.PrintArea = "$B$2:$K$26"
ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True
ActiveSheet.PageSetup.PrintArea = ""
PrintForm.Hide
Range("A4").Select
Range("B2:J2").Select
End Sub
=========================================================
Any suggestions would be greatly appreciated.
Thanks,
Steve
Split from
https://www.mrexcel.com/forum/excel-questions/1089413-highlight-cell-based-position-active-cell.html
Last edited by a moderator: