ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Import plain text with formulas into Excel (https://www.excelbanter.com/excel-discussion-misc-queries/50252-import-plain-text-formulas-into-excel.html)

schmiedel

Import plain text with formulas into Excel
 

I'm having some trouble in Excel. If I create a plain text file like the
following:

1,2,3
4,5,6
=sum(a1:a2), =sum(b1:b2)

Nothing can be done as if in spanish is (SI), iserror is (ESERROR), and
so on. This really sucks as I can't just install other software on the
server nor make other modifications.

I don't know what Microsoft was thinking when they translated the
versions; any Excel version should accept it's language commands and
English commands, but well, that's too much to ask for...

Any good sugestions?

Regards


--
schmiedel
------------------------------------------------------------------------
schmiedel's Profile: http://www.excelforum.com/member.php...o&userid=28086
View this thread: http://www.excelforum.com/showthread...hreadid=475927


Dave Peterson

Read the text file and parse it yourself.

When you find a value that looks like a formula (starts with an equal sign??),
you can process that string special.

Chip Pearson has some code at:
http://www.cpearson.com/excel/imptext.htm

It looks to me like there would be one line to change:

Cells(RowNdx, ColNdx).Value = TempVal
becomes
Cells(RowNdx, ColNdx).Formula = TempVal

But be a little careful.

If your text strings contain commas:
=if(a1="",a1+3,a1^2)
You'll have to parse that as one string.





schmiedel wrote:

I'm having some trouble in Excel. If I create a plain text file like the
following:

1,2,3
4,5,6
=sum(a1:a2), =sum(b1:b2)

Nothing can be done as if in spanish is (SI), iserror is (ESERROR), and
so on. This really sucks as I can't just install other software on the
server nor make other modifications.

I don't know what Microsoft was thinking when they translated the
versions; any Excel version should accept it's language commands and
English commands, but well, that's too much to ask for...

Any good sugestions?

Regards

--
schmiedel
------------------------------------------------------------------------
schmiedel's Profile: http://www.excelforum.com/member.php...o&userid=28086
View this thread: http://www.excelforum.com/showthread...hreadid=475927


--

Dave Peterson

Dave Peterson

This line doesn't apply:

When you find a value that looks like a formula (starts with an equal sign??),
you can process that string special.


I looked at Chip's code after I wrote that and should have deleted that
sentence.

Dave Peterson wrote:

Read the text file and parse it yourself.

When you find a value that looks like a formula (starts with an equal sign??),
you can process that string special.

Chip Pearson has some code at:
http://www.cpearson.com/excel/imptext.htm

It looks to me like there would be one line to change:

Cells(RowNdx, ColNdx).Value = TempVal
becomes
Cells(RowNdx, ColNdx).Formula = TempVal

But be a little careful.

If your text strings contain commas:
=if(a1="",a1+3,a1^2)
You'll have to parse that as one string.

schmiedel wrote:

I'm having some trouble in Excel. If I create a plain text file like the
following:

1,2,3
4,5,6
=sum(a1:a2), =sum(b1:b2)

Nothing can be done as if in spanish is (SI), iserror is (ESERROR), and
so on. This really sucks as I can't just install other software on the
server nor make other modifications.

I don't know what Microsoft was thinking when they translated the
versions; any Excel version should accept it's language commands and
English commands, but well, that's too much to ask for...

Any good sugestions?

Regards

--
schmiedel
------------------------------------------------------------------------
schmiedel's Profile: http://www.excelforum.com/member.php...o&userid=28086
View this thread: http://www.excelforum.com/showthread...hreadid=475927


--

Dave Peterson


--

Dave Peterson


All times are GMT +1. The time now is 12:22 AM.

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