How to count the the numbers in the excel cell

Hi, hope everyone doing good

I have to read excel and I want to take a particular column from excel in that each cell have a number like 12345678 AND 1234567 so hear we have two value one is 8 digit and one is 7 digits so in this how-to get to know this i 7 digit or this 8 dight
because the process will change if its 8 digits we have done another process if it’s a 7 digit we have to do another process

Can anyone please help how to count the number ?

Chethan P

Hi @copy_writes

If you are holding these numbers (12345678 AND 1234567) in a variable lets say Digits_count

Digits_count.ToString.Length will give the number of digits in the number and use IF condition to control the flow in the way it is required

Hope this is helpful


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