Select current row, add highlight, then select next cell in same column

linesite

New Member
Joined
Oct 10, 2009
Messages
41
I have about 350 rows of data that I need to reconcile manually with another data source. I'm having difficulty writing VBA to select and highlight the current row (cell A2 to E2) based on the cell selection (A2) then select the cell (A3) after the highlight application. Can someone help? This code highlights the entire table--I want to examine each row individually line-by-line add highlight then go to the next row in column A to research my source data before adding highlight to that row based on my research.

Sub Highlight_Active_Row()

Dim myWB As Workbook
Dim myWS As Worksheet
Dim myFirstCell As Range
Dim myLastCell As Range
Dim myRange As Range

Set myWB = ActiveWorkbook
Set myWS = myWB.ActiveSheet
Set myFirstCell = Application.ActiveCell
Set myLastCell = myWS.Cells(Application.ActiveCell, 5)
Set myRange = Range(myFirstCell, myLastCell)

myRange.Interior.ColorIndex = 37

End Sub


DateNo.DescriptionPaymentCredit
10/30/2020​
Transfer
10​
10/30/2020​
Transfer
25​
10/30/2020​
Transfer
25​
10/30/2020​
Transfer
25​
10/30/2020​
Transfer
25​
 

Excel Facts

Easy bullets in Excel
If you have a numeric keypad, press Alt+7 on numeric keypad to type a bullet in Excel.
How about ...

VBA Code:
Sub Highlight_Active_Row_R2()

    Dim rng As Range
   
    Set rng = Selection
    If rng.Count = 1 Then
        rng.Resize(1, 5).Interior.ColorIndex = 37
        rng.Offset(1).Select
    End If
End Sub
 
Upvote 0
Solution
You are welcome and thanks for letting me know.
 
Upvote 0

Forum statistics

Threads
1,214,943
Messages
6,122,369
Members
449,080
Latest member
Armadillos

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