View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
RB Smissaert RB Smissaert is offline
external usenet poster
 
Posts: 2,452
Default Simple VBA code not working on new laptop

Put Option Explicit at the top of that module, try to compile (Debug,
Compile VBA Project) and you will see what the trouble is.
Best to have this always at the top of all modules, so do:
Tools, Options, Editor, tick Require variable declaration.

RBS


"Alex" wrote in message
...
I have the following code that is working fine on my PC, but I just got a
new
laptop and it stops working on the line "ActiveSheet.Paste". I don't know
where to begin to look. Security is set to low. Thanks for your help.

Sub OpOutOfSequence()

Range("A1").Select
Range(Selection, Selection.End(x1ToRight)).Select
Range(Selection, Selection.End(x1down)).Select
Selection.Copy
Workbooks.Add
ActiveSheet.Paste