ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   vba programming copy/ paste cell values help. (https://www.excelbanter.com/excel-programming/291239-vba-programming-copy-paste-cell-values-help.html)

yaoming

vba programming copy/ paste cell values help.
 
Hi i have hundreds of values in an excel workbook with formulas, etc...
I want to be able to write a macro that would autmoatically take th
vertical columns and have all the values go horizontally and vic
versa.

FOr exmaple.

2 3 4 5 6 would be when i run the macro...

2
4
6
7

and when i run the macro again it should be

2 3 4 5 6.

I need this to work from sheet to sheet with lots and lots of data.
am stumped! thanks

--
Message posted from http://www.ExcelForum.com


Tom Ogilvy

vba programming copy/ paste cell values help.
 
Look at turning on the macro recorder and using copy , then paste special
selecting transpose.

there really isn't enough information here to provide much help. You have
to have someplace to put your data when you transpose it. Since you say you
have a lot of data, it is unclear where it is located and where you want to
place it. Also, rows go to 65536, but columns only go to 256 - more
questions.

Since your values are produced with formulas, it would be important to
understand if you want them to continue to point at the same locations
(requires absolute references) or what you want them to do.

--
Regards,
Tom Ogilvy


yaoming wrote in message
...
Hi i have hundreds of values in an excel workbook with formulas, etc...
I want to be able to write a macro that would autmoatically take the
vertical columns and have all the values go horizontally and vice
versa.

FOr exmaple.

2 3 4 5 6 would be when i run the macro...

2
4
6
7

and when i run the macro again it should be

2 3 4 5 6.

I need this to work from sheet to sheet with lots and lots of data. I
am stumped! thanks.


---
Message posted from http://www.ExcelForum.com/




yaoming[_2_]

vba programming copy/ paste cell values help.
 
well imagine a sheet is like this all filled:


1234
4567
8910


So, i want a macro with data that is already on the sheet to switc
spots, or positions to this.

148
259
361
470

Is this possible. But for now, i just want to find out a way to cop
and paste the cells. Formulas are not important

--
Message posted from http://www.ExcelForum.com


Tom Ogilvy

vba programming copy/ paste cell values help.
 
Select the data, do edit =Copy, select another location, do Edit=Paste
Special and select the Transpose box at the bottom of the dialog.

--
Regards,
Tom Ogilvy

"yaoming " wrote in message
...
well imagine a sheet is like this all filled:


1234
4567
8910


So, i want a macro with data that is already on the sheet to switch
spots, or positions to this.

148
259
361
470

Is this possible. But for now, i just want to find out a way to copy
and paste the cells. Formulas are not important.


---
Message posted from http://www.ExcelForum.com/





All times are GMT +1. The time now is 01:23 PM.

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