ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Copy ActiveWorksheet Columns B,C,F to Another Worksheet in Workboo (https://www.excelbanter.com/excel-programming/398744-copy-activeworksheet-columns-b-c-f-another-worksheet-workboo.html)

Joe K.

Copy ActiveWorksheet Columns B,C,F to Another Worksheet in Workboo
 

I would like to copy from the ActiveWorksheet Columns B2,C2,F2 starting at
row 3 until B column row is null to the TEST worksheet. The TEST worksheet
will start at row 2 because of headers the column mappings will correspond to
the list below.


ActiveWorksheet.Column Test.Column
B D
C F
F H

Please help me with this script.

Thanks so much for your help.


Steve Yandl

Copy ActiveWorksheet Columns B,C,F to Another Worksheet in Workboo
 
I think I understand what you want to do. See if the sub below takes care
of it.

_________________________________

Sub TransferColumns()
Dim rngOriginB As Range
Dim rngOriginC As Range
Dim rngOriginF As Range

Dim rowTop As Integer

Application.ScreenUpdating = False

rowTop = Range("B65536").End(xlUp).Row

Set rngOriginB = Range("B3:B" & rowTop)
Set rngOriginC = Range("C3:C" & rowTop)
Set rngOriginF = Range("F3:F" & rowTop)

rngOriginB.Copy
Sheets("Test").Activate
ActiveSheet.Paste (Sheets("Test").Range("D2"))

rngOriginC.Worksheet.Activate
rngOriginC.Copy
Sheets("Test").Activate
ActiveSheet.Paste (Sheets("Test").Range("F2"))

rngOriginF.Worksheet.Activate
rngOriginF.Copy
Sheets("Test").Activate
ActiveSheet.Paste (Sheets("Test").Range("H2"))

Application.ScreenUpdating = True

End Sub

___________________________________

Steve



"Joe K." <Joe wrote in message
...

I would like to copy from the ActiveWorksheet Columns B2,C2,F2 starting at
row 3 until B column row is null to the TEST worksheet. The TEST worksheet
will start at row 2 because of headers the column mappings will correspond
to
the list below.


ActiveWorksheet.Column Test.Column
B D
C F
F H

Please help me with this script.

Thanks so much for your help.





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

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