Link to home
Start Free TrialLog in
Avatar of RWayneH
RWayneHFlag for United States of America

asked on

Simple Procedure Edit

The following code, selects the next 500 lines and runs the code.

Sub MakeSIF_FromNext500Rows()
'
    Range(ActiveCell, ActiveCell.Offset(499, 0)).Copy
    Sheets("Order Line Items").Select
    Range("H2").Select
    ActiveSheet.Paste
    Application.Run "CU50BySalesOrder.xlsm!insert_mktg_prog"
    Sheets("Order Line Items").Select
    Call ClearResetSIFSheet
    Sheets("MasterCopy").Select
    ActiveCell.Offset(500, 0).Select
End Sub

Open in new window


How do you chg this so it would work on whatever cells are pre-selected?  Need to chg Ln3 and Ln11
Please advise and thanks.
ASKER CERTIFIED SOLUTION
Avatar of Ejgil Hedegaard
Ejgil Hedegaard
Flag of Denmark image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
No points, but agreeing with Ejgil on line 3 change.  As for Line 11, it's really no longer necessary.  However, if you wanted the user's active cell to move to the next cell after the active selection (like it did above), you could change line 11 to:
ActiveCell.Offset(Selection.Rows.Count, 0).Select

Open in new window


-Glenn
Avatar of RWayneH

ASKER

Thanks for the help.  I cannot believe I did not figure that out...