How to Highlight Row with last cell entry

HYKE

Active Member
Joined
Jan 31, 2010
Messages
373
Hi,

Can somebody help me highlight the row of the cell last updated, here is the code
Code:
Private Sub CommandButton1_Click()
 Dim r As Long
    With Sheet1
         r = Application.Match(ComboBox1.Value, .Range("B:B"), False)
        
        .Cells(r, 4).Value = .Cells(r, 4).Value + Val(TextBox2.Value)
        .Cells(r, 5).Value = .Cells(r, 5).Value + Val(TextBox3.Value)
        .Cells(r, 6).Value = .Cells(r, 6).Value + Val(TextBox4.Value)
        .Cells(r, 7).Value = TextBox5.Value
        .Cells(r, 8).Value = TextBox6.Value
        .Cells(r, 9).Value = TextBox7.Value
      
       
        TextBox2.Value = ""
        TextBox3.Value = ""
        TextBox4.Value = ""
        TextBox5.Value = ""
        TextBox6.Value = ""
        TextBox7.Value = ""
        ComboBox1.Value = ""
        
        [COLOR=red]Rows(ActiveCell.Row).Select - this code does not make the last updated cell as active.[/COLOR]
       
    End With
End Sub

Thanks,
HYKE
 

Excel Facts

Difference between two dates
Secret function! Use =DATEDIF(A2,B2,"Y")&" years"&=DATEDIF(A2,B2,"YM")&" months"&=DATEDIF(A2,B2,"MD")&" days"
Thanks Vog! I have never thought it would be that simple....I have been trying to figure it out for hours...
 
Upvote 0

Forum statistics

Threads
1,224,586
Messages
6,179,730
Members
452,939
Latest member
WCrawford

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