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"
 
Hello Pandi
See VBA help for CurrentRegion and Offset
HTH
Regards
Pascal
 
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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top