ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   VB copy paste column data to another left to right sheet across sh (https://www.excelbanter.com/excel-programming/359544-vbulletin-copy-paste-column-data-another-left-right-sheet-across-sh.html)

Baz

VB copy paste column data to another left to right sheet across sh
 
Hi I want to copy and paste a column of data using visual basic onto another
data sheet in the same workbook. So that comums run accross the paste sheet
left to right.
I have done this copy and past one column but the next pastes over the last
on the second sheet.

broro183[_84_]

VB copy paste column data to another left to right sheet across sh
 

Hi Baz,

Can you please provide a little more detail/clarity on what you want to
do?
eg please include the problematic code...

If the columns you are copying are not side by side (eg columns A,C &
E, rather than columns A,B & C) but you want them to be pasted side by
side in the new sheet try adapting the following:

Sheets("Sheet2").Range("A:c, f:f").Copy Sheets("Sheet3").Range("a1")

However, if you want them to be pasted in the same relative locations
that they currently exist in the original sheet, have a look at John
W's "Copy multiple selections" at:
http://www.j-walk.com/ss/excel/tips/tip36.htm

hth
Rob Brockett
NZ
Always learning & the best way to learn is to experience...


--
broro183
------------------------------------------------------------------------
broro183's Profile: http://www.excelforum.com/member.php...o&userid=30068
View this thread: http://www.excelforum.com/showthread...hreadid=535301


cucchiaino

VB copy paste column data to another left to right sheet across sh
 
baz wrote:

Hi I want to copy and paste a column of data using visual basic onto another
data sheet in the same workbook. So that comums run accross the paste sheet
left to right.
I have done this copy and past one column but the next pastes over the last
on the second sheet.


Hi, baz.

Try

Sub bazcopy()

With ActiveSheet
Worksheets(.Index + 1).Columns("A:A").Value = _
.Columns("A:A").Value
End With

End Sub


()---cucchiaino
www.riolab.org


All times are GMT +1. The time now is 12:29 PM.

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