Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 108
Default Saving cell content externally.

Using XL 2000

Cell A1 in my worksheet contains concatenated data.
There will be upto 200 rows.

I'm looking for a code solution that would loop through
each cell in the range (A1:A100), collect and save the
content, line by line in a text file on my local drive.

Each time the macro was executed, The new data would
overwrite the existing file.

If possible, any ideas appreciated.
Many thanks
Paul

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Saving cell content externally.

Activesheet.copy
ActiveSheet.Rows(101).Resize(65536-100).EntireRow.Delete
Range("A1:A100").Formula = Range("A1:A100").Value
Columns(2).Resize(,255).Delete
On Error Resume Next
kill "C:\MyData\Myfile.Txt"
On Error goto 0
ActiveWorkbook.SaveAs "C:\MyData\Myfile.txt", FileFormat:=xlText
ActiveWorkbook.Close SaveChanges:=False

--
Regards,
Tom Ogilvy

"Paul" wrote in message
...
Using XL 2000

Cell A1 in my worksheet contains concatenated data.
There will be upto 200 rows.

I'm looking for a code solution that would loop through
each cell in the range (A1:A100), collect and save the
content, line by line in a text file on my local drive.

Each time the macro was executed, The new data would
overwrite the existing file.

If possible, any ideas appreciated.
Many thanks
Paul



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 108
Default Saving cell content externally.

Thank you Tom.
Your solutions, as usual, are perfect!

Paul

-----Original Message-----
Activesheet.copy
ActiveSheet.Rows(101).Resize(65536-100).EntireRow.Delete
Range("A1:A100").Formula = Range("A1:A100").Value
Columns(2).Resize(,255).Delete
On Error Resume Next
kill "C:\MyData\Myfile.Txt"
On Error goto 0
ActiveWorkbook.SaveAs "C:\MyData\Myfile.txt",

FileFormat:=xlText
ActiveWorkbook.Close SaveChanges:=False

--
Regards,
Tom Ogilvy

"Paul" wrote in

message
...
Using XL 2000

Cell A1 in my worksheet contains concatenated data.
There will be upto 200 rows.

I'm looking for a code solution that would loop through
each cell in the range (A1:A100), collect and save the
content, line by line in a text file on my local drive.

Each time the macro was executed, The new data would
overwrite the existing file.

If possible, any ideas appreciated.
Many thanks
Paul



.

Reply
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
finding text within a document externally, not internally barcla Excel Discussion (Misc queries) 1 December 1st 08 04:38 PM
Cell content surrounded by quotes when saving as tab delimited for Jerry New Users to Excel 2 March 4th 08 10:40 PM
Remove content when saving / loading spreadsheet EZdoesIT Excel Worksheet Functions 4 November 13th 06 03:42 PM
How do I preserve cell content when saving an excel file in csv beachwurm Excel Discussion (Misc queries) 1 June 29th 06 08:18 PM
problem with selection when calling macro externally from VB6 [email protected] Excel Programming 1 November 4th 03 08:17 PM


All times are GMT +1. The time now is 01:12 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"