Read range should pick desirable column range

I have a range of Excel cells of which the first row is the header. There are several more rows with the actual data. There can be variable number of rows.

What is the best way to select this whole range of Excel data when you don’t know how many rows and columns it contains? If I use Read Range or Select Range I will have to specify the range itself e.g. A1:?? but in this case I don’t know the location of the bottom right cell.

Preferably, I should be able to do this just by selecting the top left cell. I want to be able to do this without formatting the range as a ‘table’ or making changes to the Excel file itself.

use string.empty in your range

1 Like

by using string.empty can i be able to read range of only one column which i want

if i only want A column can i give string.empty

1 Like

String.Empty will retrieve all range in the sheet.

You can have this in datatable and use it as per your requirement

1 Like

NO, i just want only one column which the end range i didnt know.
if i give range as “A” it should pick the A column from top to the end

1 Like

if you give A it will Read all A Range for sure.

Are you facing any error?

1 Like

yeah it is not reading A column
it is showing range error

1 Like

Please share screen shot of error and your read range activity

1 Like

1 Like

@Jebarohith19 Are you able to read the Whole File as a Datatable? If you want to use Only A Column From it then you can use this Statement :
DT = DT.DefaultView.ToTable(False,“ColumnName”)

Provided you know the Column Name that you want :sweat_smile:

1 Like

in place of dt i have to use my datatable variable?
if im using excel application scope what should i do

1 Like

@Jebarohith19 Even in Excel Application Scope, You will have to do the Same thing, but with your Datatable Variable and Column Name

1 Like

thank u ill try that

1 Like

DefaultView is not a member of excelworkbook application it is showing compile time exceptio

1 Like

Create a variable and then try

1 Like

@Jebarohith19 Have you used the Datatable Variable ?

1 Like

@Jebarohith19 Send a Screenshot of the File with the Error

1 Like

Can you try by Read Column .
image
image

1 Like

in range we cannot use an activity read column

1 Like

1 Like