Selecting a range of cells in a macro

  • Thread starter Thread starter Victor Delta
  • Start date Start date
V

Victor Delta

Can anyone help me with this please.

I have written an Excel (XP) macro that has to start by selecting a range
based on the active cell and the 10 cells to its right.

How do I put this into VBA code please?

Thanks,

V
 
Here's one way:

Range(ActiveCell.Address & ":" & ActiveCell.Offset(0, 10).Address).Select

Hope that helps.
 
activecell.resize(1,11).select



Victor said:
Can anyone help me with this please.

I have written an Excel (XP) macro that has to start by selecting a range
based on the active cell and the 10 cells to its right.

How do I put this into VBA code please?

Thanks,

V
 
And Dave Peterson's method is probably faster and more efficient than mine.
 
But no matter which one is used, the OP should be able to read either to see how
each can be extended to different situations.
 
Dave Peterson said:
But no matter which one is used, the OP should be able to read either to
see how
each can be extended to different situations.

Very many thanks to you both.

V
 

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