ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   cut in macro (https://www.excelbanter.com/excel-programming/368828-cut-macro.html)

Arne Hegefors

cut in macro
 
In my macro I try to move a certain range. The macro manages to select the
range but then when I try to cut the range and then paste it elsewhere the
code just fails. The code is:

qcRange.Select
Selection.Cut
Range("c10").Select
ActiveSheet.Paste

The range qcRange is accurate and as I said it gets selected. What is wrong
with the rest of the code? Please any help is very much appreciated!! Thanks!

Harald Staff

cut in macro
 
The code says to paste in cell C10. If that isn't what you want then replace
C10 with something more suitable.

HTH. Best wishes Harald

"Arne Hegefors" skrev i melding
...
In my macro I try to move a certain range. The macro manages to select the
range but then when I try to cut the range and then paste it elsewhere the
code just fails. The code is:

qcRange.Select
Selection.Cut
Range("c10").Select
ActiveSheet.Paste

The range qcRange is accurate and as I said it gets selected. What is

wrong
with the rest of the code? Please any help is very much appreciated!!

Thanks!



Die_Another_Day

cut in macro
 
qcRange.Cut Range("C10") Works for me.

Die_Another_Day
"Arne Hegefors" wrote in message
...
In my macro I try to move a certain range. The macro manages to select the
range but then when I try to cut the range and then paste it elsewhere the
code just fails. The code is:

qcRange.Select
Selection.Cut
Range("c10").Select
ActiveSheet.Paste

The range qcRange is accurate and as I said it gets selected. What is
wrong
with the rest of the code? Please any help is very much appreciated!!
Thanks!




Arne Hegefors

cut in macro
 
Sorry but I must have been unclear. The problem is not where to paste it but
the fact that the code dies after having selected the range. After the line:

qcRange.Select

the code does not work. When walking through the code with F8 the program
just skipps the next lines....Please help me out if you know what is wrong!!!
Thanks!



"Harald Staff" skrev:

The code says to paste in cell C10. If that isn't what you want then replace
C10 with something more suitable.

HTH. Best wishes Harald

"Arne Hegefors" skrev i melding
...
In my macro I try to move a certain range. The macro manages to select the
range but then when I try to cut the range and then paste it elsewhere the
code just fails. The code is:

qcRange.Select
Selection.Cut
Range("c10").Select
ActiveSheet.Paste

The range qcRange is accurate and as I said it gets selected. What is

wrong
with the rest of the code? Please any help is very much appreciated!!

Thanks!




Arne Hegefors

cut in macro
 
Hi! Thanks for fast help but I cannot get it to work.. PÃ…erhaps there is some
problem that I declare the range like this:

Set qcRange = Range(firstDate.Address & ":" & segment.Offset(b, a).Address)

I then pass this range along in the code to different subs. However the
macro does select the right range so I cannot understand why it cannot
cut/paste..If anyone has any clue about this problem please help me out!
Thanks alot!!

"Die_Another_Day" skrev:

qcRange.Cut Range("C10") Works for me.

Die_Another_Day
"Arne Hegefors" wrote in message
...
In my macro I try to move a certain range. The macro manages to select the
range but then when I try to cut the range and then paste it elsewhere the
code just fails. The code is:

qcRange.Select
Selection.Cut
Range("c10").Select
ActiveSheet.Paste

The range qcRange is accurate and as I said it gets selected. What is
wrong
with the rest of the code? Please any help is very much appreciated!!
Thanks!





Die_Another_Day

cut in macro
 
What Error do you receive?
Die_A_D
Arne Hegefors wrote:
Hi! Thanks for fast help but I cannot get it to work.. PÅerhaps there is some
problem that I declare the range like this:

Set qcRange = Range(firstDate.Address & ":" & segment.Offset(b, a).Address)

I then pass this range along in the code to different subs. However the
macro does select the right range so I cannot understand why it cannot
cut/paste..If anyone has any clue about this problem please help me out!
Thanks alot!!

"Die_Another_Day" skrev:

qcRange.Cut Range("C10") Works for me.

Die_Another_Day
"Arne Hegefors" wrote in message
...
In my macro I try to move a certain range. The macro manages to select the
range but then when I try to cut the range and then paste it elsewhere the
code just fails. The code is:

qcRange.Select
Selection.Cut
Range("c10").Select
ActiveSheet.Paste

The range qcRange is accurate and as I said it gets selected. What is
wrong
with the rest of the code? Please any help is very much appreciated!!
Thanks!







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

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