![]() |
Cut and Paste, VB
Hi,
I recorded my step-by-step entries and changed some of the commands as follows: Sub Macro1() 'Range("Q95:Q99").Select = This code was replaced with: Range("Mo_401k").Select Application.CutCopyMode = False Selection.Cut 'Range("Q96").Select = This code was replaced with: ActiveCell.Offset(1, 0).Select ActiveSheet.Paste End Sub Even if i don't change some of the commands, the macro does not run and always highlights "Activesheet.Paste" as the error. Please help |
Cut and Paste, VB
a bit simpler. Change range to your range name and the destination cell.
Sub cutpaste() Range("d2:d5").Cut Destination:=Range("c2") End Sub -- Don Guillett SalesAid Software "Danny" wrote in message ... Hi, I recorded my step-by-step entries and changed some of the commands as follows: Sub Macro1() 'Range("Q95:Q99").Select = This code was replaced with: Range("Mo_401k").Select Application.CutCopyMode = False Selection.Cut 'Range("Q96").Select = This code was replaced with: ActiveCell.Offset(1, 0).Select ActiveSheet.Paste End Sub Even if i don't change some of the commands, the macro does not run and always highlights "Activesheet.Paste" as the error. Please help |
Cut and Paste, VB
Thank you for your response. The destination is one cell down (variable
range). How will I properly address one cell down? Thanks again. "Don Guillett" wrote: a bit simpler. Change range to your range name and the destination cell. Sub cutpaste() Range("d2:d5").Cut Destination:=Range("c2") End Sub -- Don Guillett SalesAid Software "Danny" wrote in message ... Hi, I recorded my step-by-step entries and changed some of the commands as follows: Sub Macro1() 'Range("Q95:Q99").Select = This code was replaced with: Range("Mo_401k").Select Application.CutCopyMode = False Selection.Cut 'Range("Q96").Select = This code was replaced with: ActiveCell.Offset(1, 0).Select ActiveSheet.Paste End Sub Even if i don't change some of the commands, the macro does not run and always highlights "Activesheet.Paste" as the error. Please help |
Cut and Paste, VB
Thanks again for your prompt response Don. However, it did not work. I even
replaced my named range to the actual range. "Don Guillett" wrote: range("c3") or range("c2").offset(1) -- Don Guillett SalesAid Software "Danny" wrote in message ... Thank you for your response. The destination is one cell down (variable range). How will I properly address one cell down? Thanks again. "Don Guillett" wrote: a bit simpler. Change range to your range name and the destination cell. Sub cutpaste() Range("d2:d5").Cut Destination:=Range("c2") End Sub -- Don Guillett SalesAid Software "Danny" wrote in message ... Hi, I recorded my step-by-step entries and changed some of the commands as follows: Sub Macro1() 'Range("Q95:Q99").Select = This code was replaced with: Range("Mo_401k").Select Application.CutCopyMode = False Selection.Cut 'Range("Q96").Select = This code was replaced with: ActiveCell.Offset(1, 0).Select ActiveSheet.Paste End Sub Even if i don't change some of the commands, the macro does not run and always highlights "Activesheet.Paste" as the error. Please help |
Cut and Paste, VB
I just re-tested both of these and they worked just fine. Moved the range to
the new cell, one down. Sub cutpaste() 'Range("d2:d5").Cut Destination:=Range("c2").Offset(1) Range("cpyrng").Cut Destination:=Range("c2").Offset(1) End Sub Post YOUR code for us to see and RE-state EXACTLY what you are trying to do -- Don Guillett SalesAid Software "Danny" wrote in message ... Thanks again for your prompt response Don. However, it did not work. I even replaced my named range to the actual range. "Don Guillett" wrote: range("c3") or range("c2").offset(1) -- Don Guillett SalesAid Software "Danny" wrote in message ... Thank you for your response. The destination is one cell down (variable range). How will I properly address one cell down? Thanks again. "Don Guillett" wrote: a bit simpler. Change range to your range name and the destination cell. Sub cutpaste() Range("d2:d5").Cut Destination:=Range("c2") End Sub -- Don Guillett SalesAid Software "Danny" wrote in message ... Hi, I recorded my step-by-step entries and changed some of the commands as follows: Sub Macro1() 'Range("Q95:Q99").Select = This code was replaced with: Range("Mo_401k").Select Application.CutCopyMode = False Selection.Cut 'Range("Q96").Select = This code was replaced with: ActiveCell.Offset(1, 0).Select ActiveSheet.Paste End Sub Even if i don't change some of the commands, the macro does not run and always highlights "Activesheet.Paste" as the error. Please help |
Cut and Paste, VB
Hi Don,
Sub cutpaste() ' (1) Range("d2:d5").Cut Destination:=Range("c2").Offset(1) Range("mo_401k").Cut Destination:=Range("mo_401k").Offset(1) End Sub (1) I replaced ("d:d5") with my named range ("mo_401k") - this can be anywhere in the worksheet so, the destination "=Range("c2")" does not apply. If you look at the step-by-step recorded macro I did, all I need is to cut the Named Range "mo_401k", move one cell/row down and paste it. The destination range you provided above moves to the right and one cell/row down. Thanks again. "Don Guillett" wrote: I just re-tested both of these and they worked just fine. Moved the range to the new cell, one down. Sub cutpaste() 'Range("d2:d5").Cut Destination:=Range("c2").Offset(1) Range("cpyrng").Cut Destination:=Range("c2").Offset(1) End Sub Post YOUR code for us to see and RE-state EXACTLY what you are trying to do -- Don Guillett SalesAid Software "Danny" wrote in message ... Thanks again for your prompt response Don. However, it did not work. I even replaced my named range to the actual range. "Don Guillett" wrote: range("c3") or range("c2").offset(1) -- Don Guillett SalesAid Software "Danny" wrote in message ... Thank you for your response. The destination is one cell down (variable range). How will I properly address one cell down? Thanks again. "Don Guillett" wrote: a bit simpler. Change range to your range name and the destination cell. Sub cutpaste() Range("d2:d5").Cut Destination:=Range("c2") End Sub -- Don Guillett SalesAid Software "Danny" wrote in message ... Hi, I recorded my step-by-step entries and changed some of the commands as follows: Sub Macro1() 'Range("Q95:Q99").Select = This code was replaced with: Range("Mo_401k").Select Application.CutCopyMode = False Selection.Cut 'Range("Q96").Select = This code was replaced with: ActiveCell.Offset(1, 0).Select ActiveSheet.Paste End Sub Even if i don't change some of the commands, the macro does not run and always highlights "Activesheet.Paste" as the error. Please help |
Cut and Paste, VB
Golly, Couldn't you just use range("d2").offset(1) Am I missing something here? -- Don Guillett SalesAid Software "Danny" wrote in message ... Hi Don, Sub cutpaste() ' (1) Range("d2:d5").Cut Destination:=Range("c2").Offset(1) Range("mo_401k").Cut Destination:=Range("mo_401k").Offset(1) End Sub (1) I replaced ("d:d5") with my named range ("mo_401k") - this can be anywhere in the worksheet so, the destination "=Range("c2")" does not apply. If you look at the step-by-step recorded macro I did, all I need is to cut the Named Range "mo_401k", move one cell/row down and paste it. The destination range you provided above moves to the right and one cell/row down. Thanks again. "Don Guillett" wrote: I just re-tested both of these and they worked just fine. Moved the range to the new cell, one down. Sub cutpaste() 'Range("d2:d5").Cut Destination:=Range("c2").Offset(1) Range("cpyrng").Cut Destination:=Range("c2").Offset(1) End Sub Post YOUR code for us to see and RE-state EXACTLY what you are trying to do -- Don Guillett SalesAid Software "Danny" wrote in message ... Thanks again for your prompt response Don. However, it did not work. I even replaced my named range to the actual range. "Don Guillett" wrote: range("c3") or range("c2").offset(1) -- Don Guillett SalesAid Software "Danny" wrote in message ... Thank you for your response. The destination is one cell down (variable range). How will I properly address one cell down? Thanks again. "Don Guillett" wrote: a bit simpler. Change range to your range name and the destination cell. Sub cutpaste() Range("d2:d5").Cut Destination:=Range("c2") End Sub -- Don Guillett SalesAid Software "Danny" wrote in message ... Hi, I recorded my step-by-step entries and changed some of the commands as follows: Sub Macro1() 'Range("Q95:Q99").Select = This code was replaced with: Range("Mo_401k").Select Application.CutCopyMode = False Selection.Cut 'Range("Q96").Select = This code was replaced with: ActiveCell.Offset(1, 0).Select ActiveSheet.Paste End Sub Even if i don't change some of the commands, the macro does not run and always highlights "Activesheet.Paste" as the error. Please help |
Cut and Paste, VB
As I said, my named range can be anywhere, e.i., f2:f5 or a12:a15, etc., so,
how can I address the variable of "d2". All I need is to cut the named range and paste it one cell/row below. Thanks again. Don. "Don Guillett" wrote: Golly, Couldn't you just use range("d2").offset(1) Am I missing something here? -- Don Guillett SalesAid Software "Danny" wrote in message ... Hi Don, Sub cutpaste() ' (1) Range("d2:d5").Cut Destination:=Range("c2").Offset(1) Range("mo_401k").Cut Destination:=Range("mo_401k").Offset(1) End Sub (1) I replaced ("d:d5") with my named range ("mo_401k") - this can be anywhere in the worksheet so, the destination "=Range("c2")" does not apply. If you look at the step-by-step recorded macro I did, all I need is to cut the Named Range "mo_401k", move one cell/row down and paste it. The destination range you provided above moves to the right and one cell/row down. Thanks again. "Don Guillett" wrote: I just re-tested both of these and they worked just fine. Moved the range to the new cell, one down. Sub cutpaste() 'Range("d2:d5").Cut Destination:=Range("c2").Offset(1) Range("cpyrng").Cut Destination:=Range("c2").Offset(1) End Sub Post YOUR code for us to see and RE-state EXACTLY what you are trying to do -- Don Guillett SalesAid Software "Danny" wrote in message ... Thanks again for your prompt response Don. However, it did not work. I even replaced my named range to the actual range. "Don Guillett" wrote: range("c3") or range("c2").offset(1) -- Don Guillett SalesAid Software "Danny" wrote in message ... Thank you for your response. The destination is one cell down (variable range). How will I properly address one cell down? Thanks again. "Don Guillett" wrote: a bit simpler. Change range to your range name and the destination cell. Sub cutpaste() Range("d2:d5").Cut Destination:=Range("c2") End Sub -- Don Guillett SalesAid Software "Danny" wrote in message ... Hi, I recorded my step-by-step entries and changed some of the commands as follows: Sub Macro1() 'Range("Q95:Q99").Select = This code was replaced with: Range("Mo_401k").Select Application.CutCopyMode = False Selection.Cut 'Range("Q96").Select = This code was replaced with: ActiveCell.Offset(1, 0).Select ActiveSheet.Paste End Sub Even if i don't change some of the commands, the macro does not run and always highlights "Activesheet.Paste" as the error. Please help |
Cut and Paste, VB
You NEVER said so. "can be anywhere"
If your named range was d2:d5 this will move it to d6:d9 Sub cutpaste1() lr = Application.CountA(Range("thsrng")) 'assumes no blanks Range("thsrng").Cut Destination:=Range("thsrng").Cells(1 + lr, 1) End Sub -- Don Guillett SalesAid Software "Danny" wrote in message ... As I said, my named range can be anywhere, e.i., f2:f5 or a12:a15, etc., so, how can I address the variable of "d2". All I need is to cut the named range and paste it one cell/row below. Thanks again. Don. "Don Guillett" wrote: Golly, Couldn't you just use range("d2").offset(1) Am I missing something here? -- Don Guillett SalesAid Software "Danny" wrote in message ... Hi Don, Sub cutpaste() ' (1) Range("d2:d5").Cut Destination:=Range("c2").Offset(1) Range("mo_401k").Cut Destination:=Range("mo_401k").Offset(1) End Sub (1) I replaced ("d:d5") with my named range ("mo_401k") - this can be anywhere in the worksheet so, the destination "=Range("c2")" does not apply. If you look at the step-by-step recorded macro I did, all I need is to cut the Named Range "mo_401k", move one cell/row down and paste it. The destination range you provided above moves to the right and one cell/row down. Thanks again. "Don Guillett" wrote: I just re-tested both of these and they worked just fine. Moved the range to the new cell, one down. Sub cutpaste() 'Range("d2:d5").Cut Destination:=Range("c2").Offset(1) Range("cpyrng").Cut Destination:=Range("c2").Offset(1) End Sub Post YOUR code for us to see and RE-state EXACTLY what you are trying to do -- Don Guillett SalesAid Software "Danny" wrote in message ... Thanks again for your prompt response Don. However, it did not work. I even replaced my named range to the actual range. "Don Guillett" wrote: range("c3") or range("c2").offset(1) -- Don Guillett SalesAid Software "Danny" wrote in message ... Thank you for your response. The destination is one cell down (variable range). How will I properly address one cell down? Thanks again. "Don Guillett" wrote: a bit simpler. Change range to your range name and the destination cell. Sub cutpaste() Range("d2:d5").Cut Destination:=Range("c2") End Sub -- Don Guillett SalesAid Software "Danny" wrote in message ... Hi, I recorded my step-by-step entries and changed some of the commands as follows: Sub Macro1() 'Range("Q95:Q99").Select = This code was replaced with: Range("Mo_401k").Select Application.CutCopyMode = False Selection.Cut 'Range("Q96").Select = This code was replaced with: ActiveCell.Offset(1, 0).Select ActiveSheet.Paste End Sub Even if i don't change some of the commands, the macro does not run and always highlights "Activesheet.Paste" as the error. Please help |
Cut and Paste, VB
If you only want to move d2:d5 to d3:d6 then
Sub cutpaste1() Range("thsrng").Cut Destination:=Range("thsrng").Cells(2, 1) End Sub -- Don Guillett SalesAid Software "Don Guillett" wrote in message ... You NEVER said so. "can be anywhere" If your named range was d2:d5 this will move it to d6:d9 Sub cutpaste1() lr = Application.CountA(Range("thsrng")) 'assumes no blanks Range("thsrng").Cut Destination:=Range("thsrng").Cells(1 + lr, 1) End Sub -- Don Guillett SalesAid Software "Danny" wrote in message ... As I said, my named range can be anywhere, e.i., f2:f5 or a12:a15, etc., so, how can I address the variable of "d2". All I need is to cut the named range and paste it one cell/row below. Thanks again. Don. "Don Guillett" wrote: Golly, Couldn't you just use range("d2").offset(1) Am I missing something here? -- Don Guillett SalesAid Software "Danny" wrote in message ... Hi Don, Sub cutpaste() ' (1) Range("d2:d5").Cut Destination:=Range("c2").Offset(1) Range("mo_401k").Cut Destination:=Range("mo_401k").Offset(1) End Sub (1) I replaced ("d:d5") with my named range ("mo_401k") - this can be anywhere in the worksheet so, the destination "=Range("c2")" does not apply. If you look at the step-by-step recorded macro I did, all I need is to cut the Named Range "mo_401k", move one cell/row down and paste it. The destination range you provided above moves to the right and one cell/row down. Thanks again. "Don Guillett" wrote: I just re-tested both of these and they worked just fine. Moved the range to the new cell, one down. Sub cutpaste() 'Range("d2:d5").Cut Destination:=Range("c2").Offset(1) Range("cpyrng").Cut Destination:=Range("c2").Offset(1) End Sub Post YOUR code for us to see and RE-state EXACTLY what you are trying to do -- Don Guillett SalesAid Software "Danny" wrote in message ... Thanks again for your prompt response Don. However, it did not work. I even replaced my named range to the actual range. "Don Guillett" wrote: range("c3") or range("c2").offset(1) -- Don Guillett SalesAid Software "Danny" wrote in message ... Thank you for your response. The destination is one cell down (variable range). How will I properly address one cell down? Thanks again. "Don Guillett" wrote: a bit simpler. Change range to your range name and the destination cell. Sub cutpaste() Range("d2:d5").Cut Destination:=Range("c2") End Sub -- Don Guillett SalesAid Software "Danny" wrote in message ... Hi, I recorded my step-by-step entries and changed some of the commands as follows: Sub Macro1() 'Range("Q95:Q99").Select = This code was replaced with: Range("Mo_401k").Select Application.CutCopyMode = False Selection.Cut 'Range("Q96").Select = This code was replaced with: ActiveCell.Offset(1, 0).Select ActiveSheet.Paste End Sub Even if i don't change some of the commands, the macro does not run and always highlights "Activesheet.Paste" as the error. Please help |
Cut and Paste, VB
Hi Don,
I did say "this can be anywhere in the worksheet". Anyway, it works perfectly now. Thank you for your time and effort. Have a great weekend and Thanksgiving! Danny "Don Guillett" wrote: You NEVER said so. "can be anywhere" If your named range was d2:d5 this will move it to d6:d9 Sub cutpaste1() lr = Application.CountA(Range("thsrng")) 'assumes no blanks Range("thsrng").Cut Destination:=Range("thsrng").Cells(1 + lr, 1) End Sub -- Don Guillett SalesAid Software "Danny" wrote in message ... As I said, my named range can be anywhere, e.i., f2:f5 or a12:a15, etc., so, how can I address the variable of "d2". All I need is to cut the named range and paste it one cell/row below. Thanks again. Don. "Don Guillett" wrote: Golly, Couldn't you just use range("d2").offset(1) Am I missing something here? -- Don Guillett SalesAid Software "Danny" wrote in message ... Hi Don, Sub cutpaste() ' (1) Range("d2:d5").Cut Destination:=Range("c2").Offset(1) Range("mo_401k").Cut Destination:=Range("mo_401k").Offset(1) End Sub (1) I replaced ("d:d5") with my named range ("mo_401k") - this can be anywhere in the worksheet so, the destination "=Range("c2")" does not apply. If you look at the step-by-step recorded macro I did, all I need is to cut the Named Range "mo_401k", move one cell/row down and paste it. The destination range you provided above moves to the right and one cell/row down. Thanks again. "Don Guillett" wrote: I just re-tested both of these and they worked just fine. Moved the range to the new cell, one down. Sub cutpaste() 'Range("d2:d5").Cut Destination:=Range("c2").Offset(1) Range("cpyrng").Cut Destination:=Range("c2").Offset(1) End Sub Post YOUR code for us to see and RE-state EXACTLY what you are trying to do -- Don Guillett SalesAid Software "Danny" wrote in message ... Thanks again for your prompt response Don. However, it did not work. I even replaced my named range to the actual range. "Don Guillett" wrote: range("c3") or range("c2").offset(1) -- Don Guillett SalesAid Software "Danny" wrote in message ... Thank you for your response. The destination is one cell down (variable range). How will I properly address one cell down? Thanks again. "Don Guillett" wrote: a bit simpler. Change range to your range name and the destination cell. Sub cutpaste() Range("d2:d5").Cut Destination:=Range("c2") End Sub -- Don Guillett SalesAid Software "Danny" wrote in message ... Hi, I recorded my step-by-step entries and changed some of the commands as follows: Sub Macro1() 'Range("Q95:Q99").Select = This code was replaced with: Range("Mo_401k").Select Application.CutCopyMode = False Selection.Cut 'Range("Q96").Select = This code was replaced with: ActiveCell.Offset(1, 0).Select ActiveSheet.Paste End Sub Even if i don't change some of the commands, the macro does not run and always highlights "Activesheet.Paste" as the error. Please help |
Cut and Paste, VB
Always best to state all contingencies at the outset.
Have a great weekend and Thanksgiving -- Don Guillett SalesAid Software "Danny" wrote in message ... Hi Don, I did say "this can be anywhere in the worksheet". Anyway, it works perfectly now. Thank you for your time and effort. Have a great weekend and Thanksgiving! Danny "Don Guillett" wrote: You NEVER said so. "can be anywhere" If your named range was d2:d5 this will move it to d6:d9 Sub cutpaste1() lr = Application.CountA(Range("thsrng")) 'assumes no blanks Range("thsrng").Cut Destination:=Range("thsrng").Cells(1 + lr, 1) End Sub -- Don Guillett SalesAid Software "Danny" wrote in message ... As I said, my named range can be anywhere, e.i., f2:f5 or a12:a15, etc., so, how can I address the variable of "d2". All I need is to cut the named range and paste it one cell/row below. Thanks again. Don. "Don Guillett" wrote: Golly, Couldn't you just use range("d2").offset(1) Am I missing something here? -- Don Guillett SalesAid Software "Danny" wrote in message ... Hi Don, Sub cutpaste() ' (1) Range("d2:d5").Cut Destination:=Range("c2").Offset(1) Range("mo_401k").Cut Destination:=Range("mo_401k").Offset(1) End Sub (1) I replaced ("d:d5") with my named range ("mo_401k") - this can be anywhere in the worksheet so, the destination "=Range("c2")" does not apply. If you look at the step-by-step recorded macro I did, all I need is to cut the Named Range "mo_401k", move one cell/row down and paste it. The destination range you provided above moves to the right and one cell/row down. Thanks again. "Don Guillett" wrote: I just re-tested both of these and they worked just fine. Moved the range to the new cell, one down. Sub cutpaste() 'Range("d2:d5").Cut Destination:=Range("c2").Offset(1) Range("cpyrng").Cut Destination:=Range("c2").Offset(1) End Sub Post YOUR code for us to see and RE-state EXACTLY what you are trying to do -- Don Guillett SalesAid Software "Danny" wrote in message ... Thanks again for your prompt response Don. However, it did not work. I even replaced my named range to the actual range. "Don Guillett" wrote: range("c3") or range("c2").offset(1) -- Don Guillett SalesAid Software "Danny" wrote in message ... Thank you for your response. The destination is one cell down (variable range). How will I properly address one cell down? Thanks again. "Don Guillett" wrote: a bit simpler. Change range to your range name and the destination cell. Sub cutpaste() Range("d2:d5").Cut Destination:=Range("c2") End Sub -- Don Guillett SalesAid Software "Danny" wrote in message ... Hi, I recorded my step-by-step entries and changed some of the commands as follows: Sub Macro1() 'Range("Q95:Q99").Select = This code was replaced with: Range("Mo_401k").Select Application.CutCopyMode = False Selection.Cut 'Range("Q96").Select = This code was replaced with: ActiveCell.Offset(1, 0).Select ActiveSheet.Paste End Sub Even if i don't change some of the commands, the macro does not run and always highlights "Activesheet.Paste" as the error. Please help |
All times are GMT +1. The time now is 12:54 PM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com