Link to home
Start Free TrialLog in
Avatar of matthews_30
matthews_30

asked on

in VB how to know the last record of an excel spreadsheet?

i have an spreadsheet that has 3 columns and the data in every field is populated every month, so always the amount of data may varies.

for example, some months i can have from cell a1 to cell c32, and in other months i can have from cell a1 to cell c43

i need to know the final cell, in this example, c43.

additional.

i always have 3 columns, A, B and C.

thanks a lot.

matt
Avatar of R_Rajesh
R_Rajesh

Hi matthews_30,
try this:

Range("C65536").End(xlUp).Address(0, 0)

Rajesh
ASKER CERTIFIED SOLUTION
Avatar of R_Rajesh
R_Rajesh

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
ActiveSheet.Range("a1").SpecialCells(xlCellTypeLastCell).Column ' last cell on a column
ActiveSheet.Range("c1").SpecialCells(xlCellTypeLastCell).Row  ' last cell on c row