Hi,
I am having an issue with providing the correct syntax to select a column in my source worksheet and then copy and paste this column into my target worksheet.
My Workbook (executing the code) we'll call MainBook. The Source Workbook is SourceBook (XferArray(1)). The Source Sheet is SourceSheet (XferArray(3)). The Target sheet is Tmp Tab.
My Code is:
Any help would greatly be appreciated.
Thanks
I am having an issue with providing the correct syntax to select a column in my source worksheet and then copy and paste this column into my target worksheet.
My Workbook (executing the code) we'll call MainBook. The Source Workbook is SourceBook (XferArray(1)). The Source Sheet is SourceSheet (XferArray(3)). The Target sheet is Tmp Tab.
My Code is:
Code:
Windows(XferArray(1)).Activate
For i = 0 To UBound(OrgTrgColH)
'XferArray(1) = Workbook Name
'XferArray(3) = Sheet Name
'OrgTrgColH(x,0) = Original Column Number XferArray(3) sheet
'OrgTrgColH(x,2) = New Column Number in Tmp Tab sheet
Workbooks(XferArray(1)).Sheets(XferArray(3)).Activate
[PHP]Columns(Int(OrgTrgColH(i, 0)), Int(OrgTrgColH(i, 0))).Select[/PHP]
Selection.Copy
Workbooks(XferArray(1)).Sheets("Tmp Tab").Activate
Columns(OrgTrgColH(i, 2), OrgTrgColH(i, 2)).Select
ActiveSheet.Paste
Windows(ThisWorkbook.Name).Activate
Next i
Any help would greatly be appreciated.
Thanks