ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   create text file (https://www.excelbanter.com/excel-programming/416813-create-text-file.html)

fth

create text file
 
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


papou[_4_]

create text file
 
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" a écrit dans le message de news:
...
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




fth

create text file
 
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" a écrit dans le message de news:
...
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






All times are GMT +1. The time now is 08:37 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com