PC Review


Reply
Thread Tools Rate Thread

create text file

 
 
fth
Guest
Posts: n/a
 
      10th Sep 2008
Hi,

i have a workbook with 2 column;
column1 with
tata
toto
titi
column 2 with
=CONCATENATE("md """,A1,"""")

with this code,
Range("A3:A10").Copy
Workbooks.Add
ActiveSheet.Past

ActiveSheet.SaveAs "C:\UserTemp\MD_Designation2.bat",
FileFormat:=xlTextWindows
ActiveWorkbook.Close

the result is:
tata
toto
titi

but if I take column with concatenate:

the result is
REF
REF
REF..

what's wrong?

best regards,

Frederic

 
Reply With Quote
 
 
 
 
papou
Guest
Posts: n/a
 
      10th Sep 2008
Hi
This is a normal behaviour, since your are copying cells with formulas.
And these formulas cannot calculate on your new workbook.
You should use this method instead:
Range("A3:A10").Copy
Workbooks.Add
ActiveSheet.Range("A1").PasteSpecial Paste:=xlPasteValues
Application.CutCopyMode = False

HTH
Cordially
Pascal

"fth" <(E-Mail Removed)> a écrit dans le message de news:
80A98CCE-14E0-42F4-95E6-(E-Mail Removed)...
> Hi,
>
> i have a workbook with 2 column;
> column1 with
> tata
> toto
> titi
> column 2 with
> =CONCATENATE("md """,A1,"""")
>
> with this code,
> Range("A3:A10").Copy
> Workbooks.Add
> ActiveSheet.Past
>
> ActiveSheet.SaveAs "C:\UserTemp\MD_Designation2.bat",
> FileFormat:=xlTextWindows
> ActiveWorkbook.Close
>
> the result is:
> tata
> toto
> titi
>
> but if I take column with concatenate:
>
> the result is
> REF
> REF
> REF..
>
> what's wrong?
>
> best regards,
>
> Frederic
>



 
Reply With Quote
 
fth
Guest
Posts: n/a
 
      10th Sep 2008
Thanks,

much better ;-)


"papou" wrote:

> Hi
> This is a normal behaviour, since your are copying cells with formulas.
> And these formulas cannot calculate on your new workbook.
> You should use this method instead:
> Range("A3:A10").Copy
> Workbooks.Add
> ActiveSheet.Range("A1").PasteSpecial Paste:=xlPasteValues
> Application.CutCopyMode = False
>
> HTH
> Cordially
> Pascal
>
> "fth" <(E-Mail Removed)> a écrit dans le message de news:
> 80A98CCE-14E0-42F4-95E6-(E-Mail Removed)...
> > Hi,
> >
> > i have a workbook with 2 column;
> > column1 with
> > tata
> > toto
> > titi
> > column 2 with
> > =CONCATENATE("md """,A1,"""")
> >
> > with this code,
> > Range("A3:A10").Copy
> > Workbooks.Add
> > ActiveSheet.Past
> >
> > ActiveSheet.SaveAs "C:\UserTemp\MD_Designation2.bat",
> > FileFormat:=xlTextWindows
> > ActiveWorkbook.Close
> >
> > the result is:
> > tata
> > toto
> > titi
> >
> > but if I take column with concatenate:
> >
> > the result is
> > REF
> > REF
> > REF..
> >
> > what's wrong?
> >
> > best regards,
> >
> > Frederic
> >

>
>
>

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Code to create dbase file from text file? Hilton Microsoft Excel Misc 0 9th Oct 2008 10:37 AM
From Immediate window to Text file - create a log file Dan Microsoft Excel Programming 1 17th Apr 2008 03:05 AM
Create Macro to import fixed width text from clipboard or text file and update table ghadley_00@yahoo.com Microsoft Access External Data 5 31st Dec 2005 03:02 PM
Create Macro to import fixed width text from clipboard or text file and update table ghadley_00@yahoo.com Microsoft Access Macros 1 30th Dec 2005 07:37 PM
take 8.5X11 text and reduce it to 5'X5.5' text to create PDF file =?Utf-8?B?TGVuSA==?= Microsoft Word Document Management 1 30th Oct 2005 07:41 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 12:32 PM.