Hi
I have a spreadsheet and need to archive the records on several worksheets without removing them. To do this I would like to format the text on each record to strikethrough. I have written this code but it isn't working right:
Sub Archive_Calculate()
Dim r As Range, cell As Range
On Error GoTo ErrHandler
'Look up range C5:C44
Set r = Me.Range("C5:C44")
Application.ScreenUpdating = False
Application.EnableEvents = False
'Wherever the Letter A occurs, select entire row
'and format Font as Strikethrough
For Each cell In r
If cell.Value = "A" Then
cell.EntireRow.Select
.Font.Strikethrough
End If
End With
ErrHandler:
Application.ScreenUpdating = True
Application.EnableEvents = True
End Sub
I then need to update 5 other sheets; Sheet names are Grades, Term1, Term2, Term3, Term4
Any suggestions appreciated as I am very new at vba.
Tanya
I have a spreadsheet and need to archive the records on several worksheets without removing them. To do this I would like to format the text on each record to strikethrough. I have written this code but it isn't working right:
Sub Archive_Calculate()
Dim r As Range, cell As Range
On Error GoTo ErrHandler
'Look up range C5:C44
Set r = Me.Range("C5:C44")
Application.ScreenUpdating = False
Application.EnableEvents = False
'Wherever the Letter A occurs, select entire row
'and format Font as Strikethrough
For Each cell In r
If cell.Value = "A" Then
cell.EntireRow.Select
.Font.Strikethrough
End If
End With
ErrHandler:
Application.ScreenUpdating = True
Application.EnableEvents = True
End Sub
I then need to update 5 other sheets; Sheet names are Grades, Term1, Term2, Term3, Term4
Any suggestions appreciated as I am very new at vba.
Tanya