Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Excel / New Users / July 2007

Tip: Looking for answers? Try searching our database.

Macro to copy

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
pcor - 16 Jul 2007 17:42 GMT
I would like a macro that will do the following:
Copy data from A1 to b1 to c1 to d1 to e1 to e2 to e3 to e4 to d4 to c4 to
b4 to a4 to a3 to a2
(I am created a rectangle with the data.
What make it more complicated is that I want that macro to do this same
function from anywhere on the sheet- (Ie- start from the select cell and go
to the right 4 times then down 3 then left 4 and up to the start point
I would appreciate any help\Thanks
Don Guillett - 16 Jul 2007 18:10 GMT
Play with this
Sub copyactivecell()
With ActiveCell
.Copy
.Resize(4, 1).PasteSpecial
.Resize(1, 4).PasteSpecial
.Offset(0, 3).Resize(4, 1).PasteSpecial
.Offset(4, 0).Resize(1, 4).PasteSpecial
End With
Application.CutCopyMode = False
End Sub

Signature

Don Guillett
Microsoft MVP Excel
SalesAid Software
dguillett1@austin.rr.com

>I would like a macro that will do the following:
> Copy data from A1 to b1 to c1 to d1 to e1 to e2 to e3 to e4 to d4 to c4 to
[quoted text clipped - 5 lines]
> to the right 4 times then down 3 then left 4 and up to the start point
> I would appreciate any help\Thanks
pcor - 16 Jul 2007 21:46 GMT
Not much luck with that...got different errors including telling me the
clipboard contained data the wrong size
Thanks for the Effort

> Play with this
> Sub copyactivecell()
[quoted text clipped - 17 lines]
> > to the right 4 times then down 3 then left 4 and up to the start point
> > I would appreciate any help\Thanks
Don Guillett - 16 Jul 2007 23:09 GMT
Funny, I put my cursor on a cell > put x in it>fired the macro and all
worked just fine.
BTW, there should only be ONE dot for each line in the with statement. You
have TWO.
If you like I can send a workbook.

Microsoft MVP Excel
SalesAid Software
dguillett1@austin.rr.com

> Not much luck with that...got different errors including telling me the
> clipboard contained data the wrong size
[quoted text clipped - 23 lines]
>> > to the right 4 times then down 3 then left 4 and up to the start point
>> > I would appreciate any help\Thanks
pcor - 17 Jul 2007 03:58 GMT
you are right...removing the dot did it
THANKS

> Funny, I put my cursor on a cell > put x in it>fired the macro and all
> worked just fine.
[quoted text clipped - 33 lines]
> >> > to the right 4 times then down 3 then left 4 and up to the start point
> >> > I would appreciate any help\Thanks
Don Guillett - 17 Jul 2007 13:06 GMT
Glad to help
Signature

Don Guillett
Microsoft MVP Excel
SalesAid Software
dguillett1@austin.rr.com

>
> you are right...removing the dot did it
[quoted text clipped - 41 lines]
>> >> > point
>> >> > I would appreciate any help\Thanks

Rate this thread:






 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.