Sanders_2503
New Member
- Joined
- Mar 29, 2012
- Messages
- 2
Dear Experts,
I am converting a xls workbook into a tab delimited text file, but instead of copying the entire workbook, I want to copy the first two columns of the workbook except for the header row.
This is my code which is copying the entire workbook -
Could someone please help me understand how can I achieve this in my macro. I tried using the range(A2:B100000).Select syntax, but it didn't work.
Being a database guy for some time, its just since last month that I have started trying my hands out in writing Excel macros - so please pardon me if this is sounds like a thread not worth this forum.
Thanks a lot.
Sanders.
I am converting a xls workbook into a tab delimited text file, but instead of copying the entire workbook, I want to copy the first two columns of the workbook except for the header row.
This is my code which is copying the entire workbook -
Code:
Private Sub SaveAsTabDelimited(ByVal sFileName As String)
With ActiveWorkbook
.SaveAs FileName:=sFileName, FileFormat:=xlText, CreateBackup:=False
End With
End Sub
Public Sub Export_To_Txt_File()
SaveAsTabDelimited "C:\xxxxx\yyyyy\IKB_Data_Import.txt"
ActiveWorkbook.Close savechanges:=False
End Sub
Could someone please help me understand how can I achieve this in my macro. I tried using the range(A2:B100000).Select syntax, but it didn't work.
Being a database guy for some time, its just since last month that I have started trying my hands out in writing Excel macros - so please pardon me if this is sounds like a thread not worth this forum.
Thanks a lot.
Sanders.