LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 747
Default Copy selected columns from .xls to a .txt file question

try this

Sub Copy_Rows()

With Application
.DisplayAlerts = False
.ScreenUpdating = False
End With

FpatH = "C:\Documents and Settings\username\filename.xls"

Workbooks.Open FpatH
FileP = ActiveWorkbook.path
Range("B1:C100").Copy
Workbooks.Add
ActiveSheet.Paste

ActiveWorkbook.SaveAs Filename:= _
FileP & "\" & "1.txt", FileFormat:=xlUnicodeText,
CreateBackup:=False

ActiveWorkbook.Close True

With Application
.DisplayAlerts = True
.ScreenUpdating = True
.CutCopyMode = False
End With

End Sub




On Dec 3, 10:00*am, gedinfo wrote:
I would like to be able to copy two columns from a .xls file, columns 2
(B) and 9(I) into a .txt file for approximately 100 rows, using VBA.
What is the best way to do this?

Thank you


 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Copy and paste selected columns between Excel workbooks Orimslala Excel Programming 4 April 4th 08 10:21 AM
How I can copy / paste a selected cells to other columns in Excel M.Rafat Excel Discussion (Misc queries) 4 November 7th 06 05:42 AM
Copy selected columns only Mac Excel Programming 2 December 18th 03 01:08 PM
Beginners' Question : How to move selected columns & rows to a two dimensional array Erche DP Excel Programming 3 July 18th 03 03:25 PM
Beginners' Question : How to move selected columns & rows to a two dimensional array Erche Excel Programming 4 July 18th 03 04:19 AM


All times are GMT +1. The time now is 02:15 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"