Search code examples
excelvbatextimportms-word

Can I stop Excel from formatting my text entirely?


I'm trying to import text from a Word file into Excel, using VBA and everything is fine and dandy.

However I have not found a way to paste the data as text right away, and some of the values are translated to scientific upon pasting or changing the value (for example 9E17 becomes 9E+1)

Of course I could rewrite the code to import all this data line by line and thus set textformat for each cell but I'd rather have Excel not do this at all!

is there a command such as (made-up) application.guessformatofcell = false which prevents Excel from changing formatting on its own entirely?

Google and StackExchange searches haven't found me an answer.


Solution

  • ActiveSheet.PasteSpecial Format:="Text"