How to get the specific cell

if there are multiple values , the output would only be “DDD” as it only capture the first number
image

Another example will get “HHH”
image

Thank you.

can you explain little more on the requirement

Hi,

Can you try the following expression, if ther is no number in Column0?

result = dt.AsEnumerable.Where(function(r) r.ItemArray.Any(function(x) Microsoft.VisualBasic.Information.IsNumeric(x.toString))).Select(function(y) y("Column0").toString).First().toString

Sample20200622-3.zip (16.9 KB)

Regards,

1 Like

it works. Thank you very much :slight_smile:

I have faced some issue :slight_smile: Why I unable to get the value in A6 cell as it is a merge cells.? Also cannot max the excel worksheet. Any solution?


image

Hi,

Usually we don’t need to maximize excel window to operate using excel activities. Is there special reason for it? If you need it, perhaps you should indicate selector of excel window. it might be effective to put delay activity before Send Hot key. You might be able to Maximize Window activity, too.

Even if merged cell, we can read cell from left-upper cell as you wrote. Can you share workflow and xlsx file?

Regards,

Here is the workflow and the file. Thank you.

forum.zip (33.3 KB)

Hi,

You need to set variable to Result property of Read Cell activity as the following image. Can you try?

Regards,

1 Like

It works. Thank you for your help. :heart_eyes:

1 Like

Hi @Yoichi,

Is it possible to teach me how to use the AsEnumerable? Thinking whether it can get the first entry in column T.

e.g , I would like to get the value “12.3”
image

Hi,

In this case you don’t need to use AsEnumerable method if you can use Read Column activity as the following.

list.First(function(x) not String.IsNullOrEmpty(x.toString)).toString

Regards,

My data is at E5:E10 . How to get the first entry from that range? And it may decimal value. The value in E5: E10 will change after that.

Hi,

Hope the following helps you.

dt.AsEnumerable.First(function(r) not String.IsNullOrEmpty(r(0).ToString))(0).ToString

Regards,

1 Like

And the following error using the HC.AsEnumerable …? Please help. Thank you.


Hi,

Can you try Read Range activity instead of Read Column activity as my previous post?

Regards,

You’re fantastic :heart_eyes: it works :+1:

Sorry, I realised that is the range is empty , it will show the following error. Possible to have the value ‘-’ or ‘0’? Appreciate your help.
image

1 Like

Hi,

The expression assumes there is one or more non-blank cell.
If there is possibility all cells are blank, we need any of the following

Use below expression

arrayDataRow = dt.AsEnumerable.Where(function(r) not String.IsNullOrEmpty(r(0).ToString)).toArray()

Then check arrayDatarow.Length>0

or

  • Use try catch activity.

Regards,

Thank you for your coaching. Am I right ? But got an output “system.Data.DataRow” in cell “D11”


Hi,

Value property of Write Cell activity should be the following. Can you try?

HCvalue(0)(0).toString()

Regards,

1 Like

yes, solved :+1: Possible to have show a “-” if the value is empty ? Thank you.

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.