Hi
I am trying to copy a range of cells on a sheet which will change every month and paste them to a summary sheet that remains constant, I think I am nearly there but need to add a line of code.
This piece of code works
except that the ActiveCell is not the cell found within the searched range it is any random cell.
Could someone advise me of the additional code needed to select the found cell first please.
Thanks Dan
I am trying to copy a range of cells on a sheet which will change every month and paste them to a summary sheet that remains constant, I think I am nearly there but need to add a line of code.
VBA Code:
Dim shtName As String
shtName = ActiveSheet.Name
Range("I3:O3").Copy
Worksheets("AR Aging").Activate
Dim FindString As String
Dim Rng As Range
FindString = shtName
If Trim(FindString) <> "" Then
With Sheets("AR Aging").Range("A:A")
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
ActiveCell.Offset(0, 1).PasteSpecial
Else
MsgBox "Nothing found"
End If
End With
End If
This piece of code works
VBA Code:
ActiveCell.Offset(0, 1).PasteSpecial
Could someone advise me of the additional code needed to select the found cell first please.
Thanks Dan