Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 199
Default Selecting a range of cells in a macro

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

  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 3,365
Default Selecting a range of cells in a macro

Here's one way:

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

Hope that helps.

"Victor Delta" wrote:

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


  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 35,218
Default Selecting a range of cells in a macro

activecell.resize(1,11).select



Victor Delta wrote:

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


--

Dave Peterson
  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 3,365
Default Selecting a range of cells in a macro

And Dave Peterson's method is probably faster and more efficient than mine.

"Dave Peterson" wrote:

activecell.resize(1,11).select



Victor Delta wrote:

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


--

Dave Peterson

  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 35,218
Default Selecting a range of cells in a macro

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.

JLatham wrote:

And Dave Peterson's method is probably faster and more efficient than mine.

"Dave Peterson" wrote:

activecell.resize(1,11).select



Victor Delta wrote:

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


--

Dave Peterson


--

Dave Peterson


  #6   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 199
Default Selecting a range of cells in a macro

"Dave Peterson" wrote in message
...
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

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
macro syntax for selecting variable range Matt Excel Discussion (Misc queries) 1 October 31st 07 07:13 PM
Selecting a range of cells, how to ? Luc Excel Worksheet Functions 2 February 23rd 07 07:17 PM
Selecting a range of values on pivot table attribute with a macro Ryan Hartnett Excel Discussion (Misc queries) 1 October 24th 06 10:21 PM
Range selecting cells Alec H Excel Discussion (Misc queries) 2 March 14th 06 01:36 PM
how to combine cells by selecting range? SPIRIT New Users to Excel 3 August 20th 05 10:40 AM


All times are GMT +1. The time now is 08:32 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"