Report

Strike through when entering date [Solved/Closed]

Ask a question Bill - Last answered on Jan 2, 2016 at 12:47 AM by vcoolio
Hello,
In excel I have a row of information in six different cells. The first cell and last cell have a date format. When I enter the last date to the far right I want the whole row to show a strike through each and every cell. I can still read it but it will show me the item is closed. Any help you can give me would be greatly appreciated.

Thanks
Bill
Helpful
+8
plus moins
Hello Bill,

A Guru I most certainly am not but I am glad that I could help.

Good luck with it all and Happy New Year!

Cheerio,
vcoolio.
Was this answer helpful?  
Helpful
+6
plus moins
Hello Bill,

Perhaps the following code should do the task for you:-

Private Sub Worksheet_Change(ByVal Target As Range)

Application.ScreenUpdating = False
Application.EnableEvents = False

Dim lRow As Long
lRow = Range("A" & Rows.Count).End(xlUp).Row

For Each cell In Range("F2:F" & lRow)
     If cell.Value <> "" Then
     cell.EntireRow.Font.Strikethrough = True
     Else
     cell.EntireRow.Font.Strikethrough = False
     End If
 Next

Application.EnableEvents = True
Application.ScreenUpdating = True

End Sub


The code is a Worksheet_Change event which means it needs to be placed in the work sheet module. To do this, right click on the sheet tab, select "view code" and in the big white field that appears, paste the above code.

Go back to your work sheet. Each time that you enter a date in a cell in Column F, a strikethrough will appear across the row of data.

Please test the code in a copy of your work book first.

Following is a link to my test work book which shows you how it all works:-

https://www.dropbox.com/s/9o8t5bc5o1n2awy/Bill%28Strikethrough%2C%20worksheet_change%20event%29.xlsm?dl=0

I hope that this helps.

Cheerio,
vcoolio.
Bill- Jan 1, 2016 at 11:24 PM
Hello Vcoolio,
You my friend are the Guru of program writing, Thank you so very much. I was racking my brain out trying to figure out how to solve this problem. I am so happy I found this site with CCM. Thanks again, you are the greatest.

Cheerio,
Bill

Member requests are more likely to be responded to.

Members can monitor the statuses of their requests from their account pages.

A CCM membership gives you access to additional options.

Not a member yet?

Sign up now. It takes less than a minute and is completely free!