MACRO LOOP

Rajesh3720

New Member
Joined
Sep 18, 2022
Messages
1
Office Version
  1. 365
Platform
  1. Windows
I Want to repeat below recorded macro for each row in sheet until column E is blank

Range("E2").Select
Selection.Copy
Sheets("LOOP PARTS").Select
Range("Table1[PART_ NUMBER ]").Select
ActiveSheet.Paste
Range("Table1[XELUS _LOCATION ]").Select
Range(Selection, Selection.End(xlToRight)).Select
Application.CutCopyMode = False
Selection.Copy
Sheets("DATA").Select
Range("J2").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Range("Q2").Select
Application.CutCopyMode = False
ActiveCell.FormulaR1C1 = _
"=IF(AND(OR(RC[-6]=25827,RC[-6]=46219,R[1]C[-6]=13405),RC[-2]=0,RC[-1]=0),""LOOP"",""NOTLOOP"")"
Range("Q3").Select
 

Excel Facts

Formula for Yesterday
Name Manager, New Name. Yesterday =TODAY()-1. OK. Then, use =YESTERDAY in any cell. Tomorrow could be =TODAY()+1.
Instead of asking people to change an inefficient macro, it might be better to explain what you want to do.
The reason I mention this is because you use "Select" several times and this is under normal circumstances not required and actually slows the code down.
Also, for the future, when posting code, put it between code tags please.

Use Code Tags MrExcel.JPG
 
Upvote 0

Forum statistics

Threads
1,215,013
Messages
6,122,690
Members
449,092
Latest member
snoom82

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