Bom dia!!
Segue um exemplo.
Não testado!!
Sub AleVBA_25566()
Dim lr As Long
Dim rng As Range
Dim sh As Worksheet
Set sh = Plan1
lr = sh.Range("A" & Rows.Count).End(xlUp).Row
Set rng = sh.Range("A1:B" & lr)
rng.Offset(1, rng.Columns.Count).Resize(lr - 1, 1) = "=IF(HOUR(A2)>=10,1,0)"
rng.Offset(, rng.Columns.Count).Resize(lr - 1, 1).AutoFilter 1, 1
For i = 2 To lr
If Not Intersect(Range("B" & i), Range("B2:B" & lr).SpecialCells(xlCellTypeVisible)) Is Nothing Then
Range("B" & i).Value = 300
End If
Next
rng.AutoFilter
rng.Offset(1, rng.Columns.Count).Resize(lr - 1, 1).ClearContents
End Sub
Att
Existem mil maneiras de preparar Neston. Invente a sua!
http://www.youtube.com/ExpressoExcel
Postado : 03/08/2017 7:20 am