ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   What is wrong with this code? (https://www.excelbanter.com/excel-discussion-misc-queries/172284-what-wrong-code.html)

jlclyde

What is wrong with this code?
 
copy1.Range("A:A").Cut
copy1.Range("H:H").Paste
Application.CutCopyMode = False

When excel gets to the line of code about pasting it throws an error.
I was wondering if someone coupld enlighten me as to why?

Thanks,
Jay

JP[_4_]

What is wrong with this code?
 
Try this instead:

copy1.Range("A:A").Cut copy1.Range("H:H")

to do it all in one line, or

copy1.Range("H:H").PasteSpecial(xlPasteAll,xlPaste SpecialOperationNone,false,false)

if you need two lines.


HTH,
JP


On Jan 9, 11:48*am, jlclyde wrote:
* *copy1.Range("A:A").Cut
* *copy1.Range("H:H").Paste
* Application.CutCopyMode = False

When excel gets to the line of code about pasting it throws an error.
I was wondering if someone coupld enlighten me as to why?

Thanks,
Jay



Bob Phillips

What is wrong with this code?
 
copy1.Range("A:A").Cut copy1.Range("H1")
Application.CutCopyMode = False


--
---
HTH

Bob


(there's no email, no snail mail, but somewhere should be gmail in my addy)



"jlclyde" wrote in message
...
copy1.Range("A:A").Cut
copy1.Range("H:H").Paste
Application.CutCopyMode = False

When excel gets to the line of code about pasting it throws an error.
I was wondering if someone coupld enlighten me as to why?

Thanks,
Jay




jlclyde

What is wrong with this code?
 
On Jan 9, 10:53*am, JP wrote:
Try this instead:

copy1.Range("A:A").Cut copy1.Range("H:H")

to do it all in one line, or

copy1.Range("H:H").PasteSpecial(xlPasteAll,xlPaste SpecialOperationNone,fals*e,false)

if you need two lines.

HTH,
JP

On Jan 9, 11:48*am, jlclyde wrote:



* *copy1.Range("A:A").Cut
* *copy1.Range("H:H").Paste
* Application.CutCopyMode = False


When excel gets to the line of code about pasting it throws an error.
I was wondering if someone coupld enlighten me as to why?


Thanks,
Jay- Hide quoted text -


- Show quoted text -


Thanks. My brain is fried and I coudl not think of this. You are a
life saver, and not the little candies that you can't find anymore.
Jay

Bob I

What is wrong with this code?
 


jlclyde wrote:

On Jan 9, 10:53 am, JP wrote:

Try this instead:

copy1.Range("A:A").Cut copy1.Range("H:H")

to do it all in one line, or

copy1.Range("H:H").PasteSpecial(xlPasteAll,xlPas teSpecialOperationNone,fals*e,false)

if you need two lines.

HTH,
JP

On Jan 9, 11:48 am, jlclyde wrote:




copy1.Range("A:A").Cut
copy1.Range("H:H").Paste
Application.CutCopyMode = False


When excel gets to the line of code about pasting it throws an error.
I was wondering if someone coupld enlighten me as to why?


Thanks,
Jay- Hide quoted text -


- Show quoted text -



Thanks. My brain is fried and I coudl not think of this. You are a
life saver, and not the little candies that you can't find anymore.
Jay


Enjoy
http://www.candystand.com/


JP[_4_]

What is wrong with this code?
 
Glad it worked!

--JP

On Jan 9, 11:58*am, jlclyde wrote:

Thanks. *My brain is fried and I coudl not think of this. *You are a
life saver, and not the little candies that you can't find anymore.
Jay



All times are GMT +1. The time now is 09:11 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com