如何替换Excel工作表中的特定字符串 [英] How to replace a particular string in Excel sheet

查看:77
本文介绍了如何替换Excel工作表中的特定字符串的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何使用C#或vb.net用指定的字符串替换Excel工作表中的特定字符串



我使用的替换函数在文本文件中正常工作但是不是在excel表中

How to replace a particular string in Excel sheet with a specified string using C# or vb.net

I used a replace function which works properly in text file but not in excel sheet

推荐答案

Excel是一种复杂的文件格式,你需要用能够理解它结构的东西打开它(它不是文本文件)。 />


尝试使用: http://epplus.codeplex.com/ [ ^ ]
Excel is a complex file format, you need to open it with something that understands it's structure (it is not a text file).

Try using this : http://epplus.codeplex.com/[^]


MS Excel支持查找和替换功能。看看这里:

范围.Replace方法 [ ^ ]

Range.Find方法 [ ^ ]



样本你可以在这里找到的代码:如何:以编程方式搜索工作表范围中的文本 [ ^ ]
MS Excel supports Find and Replace functions. Have a look here:
Range.Replace method[^]
Range.Find method[^]

Sample code you'll find here: How to: Programmatically Search for Text in Worksheet Ranges[^]


这篇关于如何替换Excel工作表中的特定字符串的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆