blaineSpartan
New Member
- Joined
- May 16, 2024
- Messages
- 1
- Office Version
- 365
- Platform
- Windows
or Set variables. heres what i mean, heres the recorded macro script, just the first bits,
Sub Macro1()
'
' Macro1 Macro
'
' Keyboard Shortcut: Ctrl+g
'
Range("C5").Select
Windows("LinimarCavity7VarianceReport.xlsx").Activate
Rows("10:10").Select
Selection.Insert Shift:=xlDown, CopyOrigin:=xlFormatFromLeftOrAbove
Windows("24042513_PPAP-RDS_CAA-R03_0983.xlsx").Activate
Selection.Copy
Windows("LinimarCavity7VarianceReport.xlsx").Activate
Range("A10").Select
ActiveSheet.Paste
Windows("24042513_PPAP-RDS_CAA-R03_0983.xlsx").Activate
Range("C8").Select
Application.CutCopyMode = False
Selection.Copy
Windows("LinimarCavity7VarianceReport.xlsx").Activate
Range("B10").Select
ActiveSheet.Paste
this is just a recorded macro so it doesn't have any objects or variables i think?
where in the code it says "Windows("24042513_PPAP-RDS_CAA-R03_0983.xlsx").Activate"
what words or syntax do i need to replace ("24042513_PPAP-RDS_CAA-R03_0983.xlsx") with so that instead of copying from that specific workbook, it will copy from the location of the specific workbook i have open?
Sub Macro1()
'
' Macro1 Macro
'
' Keyboard Shortcut: Ctrl+g
'
Range("C5").Select
Windows("LinimarCavity7VarianceReport.xlsx").Activate
Rows("10:10").Select
Selection.Insert Shift:=xlDown, CopyOrigin:=xlFormatFromLeftOrAbove
Windows("24042513_PPAP-RDS_CAA-R03_0983.xlsx").Activate
Selection.Copy
Windows("LinimarCavity7VarianceReport.xlsx").Activate
Range("A10").Select
ActiveSheet.Paste
Windows("24042513_PPAP-RDS_CAA-R03_0983.xlsx").Activate
Range("C8").Select
Application.CutCopyMode = False
Selection.Copy
Windows("LinimarCavity7VarianceReport.xlsx").Activate
Range("B10").Select
ActiveSheet.Paste
this is just a recorded macro so it doesn't have any objects or variables i think?
where in the code it says "Windows("24042513_PPAP-RDS_CAA-R03_0983.xlsx").Activate"
what words or syntax do i need to replace ("24042513_PPAP-RDS_CAA-R03_0983.xlsx") with so that instead of copying from that specific workbook, it will copy from the location of the specific workbook i have open?