Friday, May 2, 2025

Inventory + Excel + VBA = ❤️

 If you are like me and you have to look at a lot of spreadsheets with things like lists of inventory, you probably start seeing the cells dance as you try to track across the row.  Is that just me?  Maybe it is a touch of dyslexia. 

I asked AI to help me find a solution and my AI buddy delivered.  Thank you AI overlord ❤️

Here is a simple VBA code snippet that you can use to highlight the row of the active cell:

  1. Press Alt + F11 to open the VBA editor.
  2. In the VBA editor, find your workbook in the Project Explorer window.
  3. Double-click on ThisWorkbook to open the code window for the workbook.
  4. Copy and paste the following code into the code window:
Private Sub Workbook_SheetSelectionChange(ByVal Sh As Object, ByVal Target As Excel.Range)
    Dim ws As Worksheet
    Set ws = Sh
    
    ' Clear previous highlights
    ws.Rows.Interior.ColorIndex = xlNone
    
    ' Highlight the active row
    ws.Rows(Target.Row).Interior.Color = RGB(255, 255, 0) ' Yellow color
End Sub

        5.  Close the VBA editor and save your workbook as a macro-enabled workbook (.xlsm).

Now, This code will highlight the row of the active cell in yellow. You can change the color by modifying the RGB values.

.Net said .No so this says .Youbetterorelsebuddy

 I was having trouble with .net framework install on new computers.  I'm not sure why it didn't work repeatedly, but found that if y...