Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 100
Default Must range be selected before a paste can be done?

Greetings! I was wondering if there is a shorter or a quicker way of
accomplishing
the following:

Range("A315:A999").Cut
Range("A300").Select
ActiveSheet.Paste
Range("C315:AE999").Cut
Range("C300").Select
ActiveSheet.Paste

I tried:
Range("A315:A999").Cut
Range("A300").Paste
Range("C315:AE999").Cut
Range("C300").Paste

but the error message I obtained upon execution said something about the
paste method not being supported here. Any help/advice will be greatly
appreciated.

May you have a blessed day.
--
May you have a most blessed day!

Sincerely,

Michael Fitzpatrick
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,942
Default Must range be selected before a paste can be done?

hi
one thing you might do is realize that you don't have to cut/copy/paste.
cut/copy/paste is a windows functions, not an excel function. excel (as all
windows applications) just uses this function.

try this...
Range("C315:AE999").value = Range("A315:A999").Value
Range("A315:A999").ClearContents

Here you are just swaping values around. trick is that both ranges must be
the same size.
seldom do you need to select and seldom to you need to cut/copy/paste unless
you just want to. and it's not a good idea to use cut/copy/paste in a loop.
if the loop is long enough, you might crash the macro due to memory problems.

regards
FSt1

"MichaelDavid" wrote:

Greetings! I was wondering if there is a shorter or a quicker way of
accomplishing
the following:

Range("A315:A999").Cut
Range("A300").Select
ActiveSheet.Paste
Range("C315:AE999").Cut
Range("C300").Select
ActiveSheet.Paste

I tried:
Range("A315:A999").Cut
Range("A300").Paste
Range("C315:AE999").Cut
Range("C300").Paste

but the error message I obtained upon execution said something about the
paste method not being supported here. Any help/advice will be greatly
appreciated.

May you have a blessed day.
--
May you have a most blessed day!

Sincerely,

Michael Fitzpatrick

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,565
Default Must range be selected before a paste can be done?

Use one line:

With ActiveSheet
Range("A315:A999").Cut Range("A300")
Range("C315:C999").Cut Range("C300")
End With


"MichaelDavid" wrote in message
...
Greetings! I was wondering if there is a shorter or a quicker way of
accomplishing
the following:

Range("A315:A999").Cut
Range("A300").Select
ActiveSheet.Paste
Range("C315:AE999").Cut
Range("C300").Select
ActiveSheet.Paste

I tried:
Range("A315:A999").Cut
Range("A300").Paste
Range("C315:AE999").Cut
Range("C300").Paste

but the error message I obtained upon execution said something about the
paste method not being supported here. Any help/advice will be greatly
appreciated.

May you have a blessed day.
--
May you have a most blessed day!

Sincerely,

Michael Fitzpatrick



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,565
Default Must range be selected before a paste can be done?

Forgot the dots.

With ActiveSheet
.Range("A315:A999").Cut Range("A300")
.Range("C315:C999").Cut Range("C300")
End With



"JLGWhiz" wrote in message
...
Use one line:

With ActiveSheet
Range("A315:A999").Cut Range("A300")
Range("C315:C999").Cut Range("C300")
End With


"MichaelDavid" wrote in message
...
Greetings! I was wondering if there is a shorter or a quicker way of
accomplishing
the following:

Range("A315:A999").Cut
Range("A300").Select
ActiveSheet.Paste
Range("C315:AE999").Cut
Range("C300").Select
ActiveSheet.Paste

I tried:
Range("A315:A999").Cut
Range("A300").Paste
Range("C315:AE999").Cut
Range("C300").Paste

but the error message I obtained upon execution said something about the
paste method not being supported here. Any help/advice will be greatly
appreciated.

May you have a blessed day.
--
May you have a most blessed day!

Sincerely,

Michael Fitzpatrick





  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 100
Default Must range be selected before a paste can be done?

Greetings! Thanks a million. After I fixed the range limits as follows, your
solution worked perfectly:

With ActiveSheet
.Range("A315:A999").Cut Range("A300")
.Range("C315:AE999").Cut Range("C300")
End With

--
May you have a most blessed evening!

Sincerely,

Michael Fitzpatrick


"JLGWhiz" wrote:

Forgot the dots.

With ActiveSheet
.Range("A315:A999").Cut Range("A300")
.Range("C315:C999").Cut Range("C300")
End With



"JLGWhiz" wrote in message
...
Use one line:

With ActiveSheet
Range("A315:A999").Cut Range("A300")
Range("C315:C999").Cut Range("C300")
End With


"MichaelDavid" wrote in message
...
Greetings! I was wondering if there is a shorter or a quicker way of
accomplishing
the following:

Range("A315:A999").Cut
Range("A300").Select
ActiveSheet.Paste
Range("C315:AE999").Cut
Range("C300").Select
ActiveSheet.Paste

I tried:
Range("A315:A999").Cut
Range("A300").Paste
Range("C315:AE999").Cut
Range("C300").Paste

but the error message I obtained upon execution said something about the
paste method not being supported here. Any help/advice will be greatly
appreciated.

May you have a blessed day.
--
May you have a most blessed day!

Sincerely,

Michael Fitzpatrick








  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 100
Default Must range be selected before a paste can be done?

Greetings! Thanks for your kind help. I tried JLGWhiz's solution first and it
worked, and being lazy, I decided to use it. If JLGWhiz's solution failed,
then I would have tried yours. Perhaps you can give me some input as to which
solution you think is superior (faster, less trouble prone, etc.) and why.
Thanks again for your kind help.
--
May you have a most blessed day!

Sincerely,

Michael Fitzpatrick


"FSt1" wrote:

hi
one thing you might do is realize that you don't have to cut/copy/paste.
cut/copy/paste is a windows functions, not an excel function. excel (as all
windows applications) just uses this function.

try this...
Range("C315:AE999").value = Range("A315:A999").Value
Range("A315:A999").ClearContents

Here you are just swaping values around. trick is that both ranges must be
the same size.
seldom do you need to select and seldom to you need to cut/copy/paste unless
you just want to. and it's not a good idea to use cut/copy/paste in a loop.
if the loop is long enough, you might crash the macro due to memory problems.

regards
FSt1

"MichaelDavid" wrote:

Greetings! I was wondering if there is a shorter or a quicker way of
accomplishing
the following:

Range("A315:A999").Cut
Range("A300").Select
ActiveSheet.Paste
Range("C315:AE999").Cut
Range("C300").Select
ActiveSheet.Paste

I tried:
Range("A315:A999").Cut
Range("A300").Paste
Range("C315:AE999").Cut
Range("C300").Paste

but the error message I obtained upon execution said something about the
paste method not being supported here. Any help/advice will be greatly
appreciated.

May you have a blessed day.
--
May you have a most blessed day!

Sincerely,

Michael Fitzpatrick

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Paste selected Range from Excel to Outlook with Disclaimer Statement & Signature Arnold1226 Excel Discussion (Misc queries) 0 November 11th 10 09:57 AM
Looping: Search Range in Multiple Selected Worksheets, Copy/Paste ryguy7272 Excel Programming 6 April 2nd 07 04:50 PM
Paste under selected cell Btobin0 Excel Discussion (Misc queries) 4 May 30th 06 01:38 AM
Context Menu, Paste Special From Selected Range [email protected] Excel Programming 0 January 20th 06 06:28 PM
How to Copy & Paste selected Range in Excel (MFC) Daniel Xu Excel Programming 6 November 25th 03 02:42 AM


All times are GMT +1. The time now is 05:54 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"