Personal.xlsb = ROW()=CELL("row")

Jon760

New Member
Joined
Jun 13, 2013
Messages
16
Hello,

I currently have conditional formatting using =ROW()=CELL("row") to highlight/underline the entire row of an active cell. As I don't the most powerful PC and my workbook now have several thousand rows it's lagging so I was wondering whether I could store this formula within a macro or create a new macro that can be stored in Personal.xlsb so that the macro is detached from the active workbook. The underline command does not have to be automatic when moving up or down row. It can be manually activated via shortcut or F9 calc.

Thank you for any help.
 

Excel Facts

Shade all formula cells
To shade all formula cells: Home, Find & Select, Formulas to select all formulas. Then apply a light fill color.
I have done this a lot. This method doesn't lag. I know it seems like too much to do, but it works. What makes it work more efficiently is using the ActiveSheet.EnableFormatConditionsCalculation command. No need to recalc.

Code placed in Sheet Module in the sheet you want to affect
VBA Code:
Private Sub Worksheet_SelectionChange(ByVal target As Range)
  
    If CurRow <> target.Row And RowMvmt = False Then
      CurRow = target.Row
      RowMvmt = True
      OT = Now() + TimeSerial(0, 0, 0.25)
      Application.OnTime EarliestTime:=OT, procedure:="NewLine", schedule:=True
      Application.OnTime EarliestTime:=Now() + TimeSerial(0, 0, 1), procedure:="NewLineRefresh", schedule:=True
    ElseIf RowMvmt = True Then
      CurRow = target.Row
      RowMvmt = False
      On Error Resume Next
      Application.OnTime EarliestTime:=OT, procedure:="NewLine", schedule:=False
      On Error GoTo 0
    End If

End Sub

Code placed in Standard module
VBA Code:
Public CurRow As Long
Public RowMvmt As Boolean
Public OT As Date

Sub NewLine()

  ActiveSheet.EnableFormatConditionsCalculation = False
  ActiveSheet.EnableFormatConditionsCalculation = True
  RowMvmt = False
  
End Sub

Sub NewLineRefresh()

  ActiveSheet.EnableFormatConditionsCalculation = False
  ActiveSheet.EnableFormatConditionsCalculation = True
  
End Sub
 
Upvote 0
I don't think that using the Personal WB will work. No events can happen across workbooks
 
Upvote 0

Forum statistics

Threads
1,223,885
Messages
6,175,184
Members
452,615
Latest member
bogeys2birdies

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top