Excel range selection

IxiRancid

Well-known member
Joined
Jun 16, 2004
Messages
104
Location
Europe
How can I select a range in Excel sheet, knowing that the range can be as big as it gets.
I have the X range fixed, however Y range is unknown.

Should I just select each row unless its value is null (yes, ALL cells in a row must be ful)? How could that be done?

Thanks!
 
IxiRancid said:
How can I select a range in Excel sheet, knowing that the range can be as big as it gets.
I have the X range fixed, however Y range is unknown.

Should I just select each row unless its value is null (yes, ALL cells in a row must be ful)? How could that be done?

Thanks!

SOLVED, this is it:

Dim first_row, first_col, num_rows, num_cols As Integer
Dim oApp As New Excel.Application
oApp.Visible = True
Dim wb As Excel.Workbook = oApp.Workbooks.Open("C:\tts.xls")
Dim ws As Excel.Worksheet = DirectCast(oApp.Sheets("maj"), Excel.Worksheet)

first_row = ws.UsedRange.Row
first_col = ws.UsedRange.Column
num_rows = ws.UsedRange.Rows.Count
num_cols = ws.UsedRange.Columns.Count
 
Back
Top