marreco
05-23-2014, 12:27 PM
Bom dia!!
Hi.
I need find a word (all columns in row 1), after (below row 2), insert fomula.
Cross-Post
http://www.excelforum.com/search.php?searchid=2913371
Sub Find_InsertFormula()
Dim lr As Long
'Call Find_First
Application.ScreenUpdating = False
With Sheets("Plan1")
lr = .Cells(.Rows.Count, "A").End(xlUp).Row - 1
.ActiveCell.Formula = "=1+1+1"
.ActiveCell.AutoFill .ActiveCell.Resize(lr - 1)
End With
Application.ScreenUpdating = True End Sub
Sub Find_First()
Dim FindString As String
Dim Rng As Range
FindString = "Atual"
If Trim(FindString) <> "" Then
With Sheets("Plan1").Range("A1:Q1")
Set Rng = .Find(What:=FindString, _
After:=.Cells(.Cells.Count), _
LookIn:=xlValues, _
LookAt:=xlWhole, _
SearchOrder:=xlByRows, _
SearchDirection:=xlNext, _
MatchCase:=False)
If Not Rng Is Nothing Then
Application.Goto Rng.Offset(2, 1), True
Else
MsgBox "Não encontrado"
End If
End With
End If End Sub
Att
Hi.
I need find a word (all columns in row 1), after (below row 2), insert fomula.
Cross-Post
http://www.excelforum.com/search.php?searchid=2913371
Sub Find_InsertFormula()
Dim lr As Long
'Call Find_First
Application.ScreenUpdating = False
With Sheets("Plan1")
lr = .Cells(.Rows.Count, "A").End(xlUp).Row - 1
.ActiveCell.Formula = "=1+1+1"
.ActiveCell.AutoFill .ActiveCell.Resize(lr - 1)
End With
Application.ScreenUpdating = True End Sub
Sub Find_First()
Dim FindString As String
Dim Rng As Range
FindString = "Atual"
If Trim(FindString) <> "" Then
With Sheets("Plan1").Range("A1:Q1")
Set Rng = .Find(What:=FindString, _
After:=.Cells(.Cells.Count), _
LookIn:=xlValues, _
LookAt:=xlWhole, _
SearchOrder:=xlByRows, _
SearchDirection:=xlNext, _
MatchCase:=False)
If Not Rng Is Nothing Then
Application.Goto Rng.Offset(2, 1), True
Else
MsgBox "Não encontrado"
End If
End With
End If End Sub
Att