ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   New Users to Excel (https://www.excelbanter.com/new-users-excel/)
-   -   Macro to copy (https://www.excelbanter.com/new-users-excel/150382-macro-copy.html)

pcor

Macro to copy
 
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

Macro to copy
 
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


--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"pcor" wrote in message
...
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



pcor

Macro to copy
 

Not much luck with that...got different errors including telling me the
clipboard contained data the wrong size
Thanks for the Effort
"Don Guillett" wrote:

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


--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"pcor" wrote in message
...
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

Macro to copy
 

Funny, I put my cursor on a cell put x in itfired 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

"pcor" wrote in message
...

Not much luck with that...got different errors including telling me the
clipboard contained data the wrong size
Thanks for the Effort
"Don Guillett" wrote:

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


--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"pcor" wrote in message
...
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





pcor

Macro to copy
 

you are right...removing the dot did it
THANKS
"Don Guillett" wrote:


Funny, I put my cursor on a cell put x in itfired 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

"pcor" wrote in message
...

Not much luck with that...got different errors including telling me the
clipboard contained data the wrong size
Thanks for the Effort
"Don Guillett" wrote:

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


--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"pcor" wrote in message
...
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

Macro to copy
 

Glad to help
--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"pcor" wrote in message
...

you are right...removing the dot did it
THANKS
"Don Guillett" wrote:


Funny, I put my cursor on a cell put x in itfired 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

"pcor" wrote in message
...

Not much luck with that...got different errors including telling me the
clipboard contained data the wrong size
Thanks for the Effort
"Don Guillett" wrote:

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


--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"pcor" wrote in message
...
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








All times are GMT +1. The time now is 12:58 AM.

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