0

When we get values by Range.Value or Range.Value2, we get the real value in excel not the same as formated text.

For example, "0.18181818" in excel may show as "0.2", and different cell has different format.

I know I can get Text value by Range.Text but this API only support one cell. Just like mentioned in this topic: Fast way to get Excel range as array of texts or cell formats in C#?

Loop over a range and get each cell's text means access COM object each time. This cause the whole progress too slow to accept.

Any efficient way to get text just like value2?

PaleNeutron
  • 2,543
  • 4
  • 25
  • 43
  • 1
    You can use `.Text` to get the visual representation of the value as it appears in the cell, but that doesn't always function as it may be expected to. You may need to format the cell value to get the desired output. – Martin Jul 15 '21 at 09:19
  • 1
    You can utilize `.Text` property like `Range("B2").Text` or have to use `FORMAT()` function to get output as desired format. – Harun24hr Jul 15 '21 at 09:21
  • @Martin, @Harun24HR, Thanks, I have called `Text` with a range(multi cells) and get nothing. Now I understand this API only works for cell range. – PaleNeutron Jul 18 '21 at 03:04

0 Answers0