Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
You have in two places X1 instead of Xl (one instead of the letter l).
Sub OpOutOfSequence() Range("A1").Select Range(Selection, Selection.End(xlToRight)).Select Range(Selection, Selection.End(xlDown)).Select Selection.Copy Workbooks.Add ActiveSheet.Paste End Sub "Alex" wrote: 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 |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I don't think x ONE will work on either.
x1 -- Don Guillett SalesAid Software "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 |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
On top of the other responses:
This line of code Range("A1").currentregion.copy can replace ALL of these lines Range("A1").Select Range(Selection, Selection.End(x1ToRight)).Select Range(Selection, Selection.End(x1down)).Select Selection.Copy "Alex" wrote: 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 |
#6
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Maybe yes /maybe no. What about a blank at cell b1?
-- Don Guillett SalesAid Software "Duke Carey" wrote in message ... On top of the other responses: This line of code Range("A1").currentregion.copy can replace ALL of these lines Range("A1").Select Range(Selection, Selection.End(x1ToRight)).Select Range(Selection, Selection.End(x1down)).Select Selection.Copy "Alex" wrote: 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 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Workbook event code won't work on laptop | Excel Worksheet Functions | |||
This should be so simple but it's not working, please help | Excel Programming | |||
simple formlas not working | New Users to Excel | |||
This should be simple but it's not working for me! | New Users to Excel | |||
Save as not working for laptop to desktop | Excel Worksheet Functions |