Change fill color after input automatically

  • Thread starter Thread starter bobocat
  • Start date Start date
B

bobocat

Hi

Do you have any suggustion for the following task.
I will make new entries to the excel list frequently. I hope that after I
input something in column A, the fill color of the entire row will change
automatically to indicate that it is a new enter. And before I close the
file, I will change back the fill color to transparent.

I recoreded a macro to change the fill color, but how can I run this macro
when I finsih input data in Column A (every worksheet)?

With best regards,
Bobocat
 
bobocat said:
I recoreded a macro to change the fill color, but how can I run this macro
when I finsih input data in Column A (every worksheet)?

Hi bobocat

Right-click the tab of a worksheet and click View Code.

Paste this in vb editor

Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Column = 1 Then
Target.EntireRow.Interior.Color = vbRed 'or whatever colour you
wish
End If
End Sub

Double-click ThisWorkbook and paste this:

Private Sub Workbook_BeforeClose(Cancel As Boolean)
Dim wks As Worksheet
For Each wks In Worksheets
wks.Cells.Interior.ColorIndex = xlNone
Next
End Sub


Regards

Steve
 
thank you.

Scoops said:
Hi bobocat

Right-click the tab of a worksheet and click View Code.

Paste this in vb editor

Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Column = 1 Then
Target.EntireRow.Interior.Color = vbRed 'or whatever colour you
wish
End If
End Sub

Double-click ThisWorkbook and paste this:

Private Sub Workbook_BeforeClose(Cancel As Boolean)
Dim wks As Worksheet
For Each wks In Worksheets
wks.Cells.Interior.ColorIndex = xlNone
Next
End Sub


Regards

Steve
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top