michaeljamesellis
New Member
- Joined
- May 29, 2024
- Messages
- 7
- Office Version
- 2021
- Platform
- Windows
I have the following macro where I have copied a company name under the line "Selection.Copy".
When I record the macro I paste this value in the find search box (control+f), however when I explore the captured script it is pasting the copied "Company Name" rather than selection paste (or similar).
This means as I later loop the macro it is not utilising the "Selection.Copy".
Any help really appreciated.
Sub Macro7()
'
' Macro7 Macro
'
'
Range("A2").Select
Selection.Copy
Sheets("Raw Data").Select
Columns("D:D").Select
Selection.Find(What:="Company Name", After:=ActiveCell, LookIn:= _
xlFormulas2, LookAt:=xlPart, SearchOrder:=xlByRows, SearchDirection:= _
xlNext, MatchCase:=False, SearchFormat:=False).Activate
Range("A1538:C1538").Select
Range("C1538").Activate
Application.CutCopyMode = False
Selection.Copy
Sheets("Ultimate Output").Select
Range("B2").Select
ActiveSheet.Paste
Range("A2:D2").Select
Application.CutCopyMode = False
Selection.Copy
Sheets("Ultimate Output (2)").Select
Range("A2").Select
ActiveSheet.Paste
Rows("2:2").Select
Application.CutCopyMode = False
Selection.Insert Shift:=xlDown, CopyOrigin:=xlFormatFromLeftOrAbove
Sheets("Ultimate Output").Select
Rows("2:2").Select
Selection.Delete Shift:=xlUp
Range("A1").Select
End Sub
When I record the macro I paste this value in the find search box (control+f), however when I explore the captured script it is pasting the copied "Company Name" rather than selection paste (or similar).
This means as I later loop the macro it is not utilising the "Selection.Copy".
Any help really appreciated.
Sub Macro7()
'
' Macro7 Macro
'
'
Range("A2").Select
Selection.Copy
Sheets("Raw Data").Select
Columns("D:D").Select
Selection.Find(What:="Company Name", After:=ActiveCell, LookIn:= _
xlFormulas2, LookAt:=xlPart, SearchOrder:=xlByRows, SearchDirection:= _
xlNext, MatchCase:=False, SearchFormat:=False).Activate
Range("A1538:C1538").Select
Range("C1538").Activate
Application.CutCopyMode = False
Selection.Copy
Sheets("Ultimate Output").Select
Range("B2").Select
ActiveSheet.Paste
Range("A2:D2").Select
Application.CutCopyMode = False
Selection.Copy
Sheets("Ultimate Output (2)").Select
Range("A2").Select
ActiveSheet.Paste
Rows("2:2").Select
Application.CutCopyMode = False
Selection.Insert Shift:=xlDown, CopyOrigin:=xlFormatFromLeftOrAbove
Sheets("Ultimate Output").Select
Rows("2:2").Select
Selection.Delete Shift:=xlUp
Range("A1").Select
End Sub