need recorded macro to copy from whatever workbook i currently have open and active rather than specific named workbook. without Dim objects or...

blaineSpartan

New Member
Joined
May 16, 2024
Messages
1
Office Version
  1. 365
Platform
  1. 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?
 

Excel Facts

Add Bullets to Range
Select range. Press Ctrl+1. On Number tab, choose Custom. Type Alt+7 then space then @ sign (using 7 on numeric keypad)
If you remove the line Windows("LinimarCavity7VarianceReport.xlsx").Activate then the instruction Rows("10:10").Select will select that line on the Active sheet of the Active workbook

Unfortunately your description is weak, not the recorded code give a fair idea of what you wish to do, so I am not able to suggest a complete macro
 
Upvote 0

Forum statistics

Threads
1,224,813
Messages
6,181,112
Members
453,021
Latest member
Justyna P

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top