create text file

  • Thread starter Thread starter fth
  • Start date Start date
F

fth

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
 
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
 
Thanks,

much better ;-)


papou said:
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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top