How to select cells?

  • Thread starter Thread starter Pandi
  • Start date Start date
P

Pandi

I have some table, I want in my VB code to select all the cells in th
table except the header.
How do I do that so if I will want to add in the future another cell
to this table the VBA code will include automatically this cells?

I had try to user the Lines:
Range(ActiveCell, ActiveCell.End(xlDown)).Select
Range(ActiveCell, ActiveCell.End(xToRight)).Select
(The active cell is "A2"
 
Some sample code:
Dim Tbl As Range
Set Tbl = Range("A1").CurrentRegion
Tbl.Offset(1, 0).Resize(Tbl.Rows.Count - 1, _
Tbl.Columns.Count).Select
Regards
Pascal


papou said:
Hello Pandi
See VBA help for CurrentRegion and Offset
HTH
Regards
Pascal
 
Back
Top