#1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 468
Default Macro-active cell

Hi, i have this code that will select from active sheet 20 cells below, on
the column.
can this code be made to select 20 cells to the right, on row?

Range(ActiveCell, Cells(ActiveCell.Row + 20, ActiveCell.Column)).Select

Can this be done?
Thanks!
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 11,501
Default Macro-active cell

Hi,

Your line of code can be simplified to

ActiveCell.Resize(21).Select

and for a column

ActiveCell.Resize(, 21).Select

My usual caveat is that no matter what you trying to do it's extremely
unlikely you need to select to do it

--
Mike

When competing hypotheses are otherwise equal, adopt the hypothesis that
introduces the fewest assumptions while still sufficiently answering the
question.


"puiuluipui" wrote:

Hi, i have this code that will select from active sheet 20 cells below, on
the column.
can this code be made to select 20 cells to the right, on row?

Range(ActiveCell, Cells(ActiveCell.Row + 20, ActiveCell.Column)).Select

Can this be done?
Thanks!

  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 11,501
Default Macro-active cell

and you can combine both

ActiveCell.Resize(21, 21).Select
--
Mike

When competing hypotheses are otherwise equal, adopt the hypothesis that
introduces the fewest assumptions while still sufficiently answering the
question.


"Mike H" wrote:

Hi,

Your line of code can be simplified to

ActiveCell.Resize(21).Select

and for a column

ActiveCell.Resize(, 21).Select

My usual caveat is that no matter what you trying to do it's extremely
unlikely you need to select to do it

--
Mike

When competing hypotheses are otherwise equal, adopt the hypothesis that
introduces the fewest assumptions while still sufficiently answering the
question.


"puiuluipui" wrote:

Hi, i have this code that will select from active sheet 20 cells below, on
the column.
can this code be made to select 20 cells to the right, on row?

Range(ActiveCell, Cells(ActiveCell.Row + 20, ActiveCell.Column)).Select

Can this be done?
Thanks!

  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 468
Default Macro-active cell

It's working great!!
Thanks!

"Mike H" wrote:

Hi,

Your line of code can be simplified to

ActiveCell.Resize(21).Select

and for a column

ActiveCell.Resize(, 21).Select

My usual caveat is that no matter what you trying to do it's extremely
unlikely you need to select to do it

--
Mike

When competing hypotheses are otherwise equal, adopt the hypothesis that
introduces the fewest assumptions while still sufficiently answering the
question.


"puiuluipui" wrote:

Hi, i have this code that will select from active sheet 20 cells below, on
the column.
can this code be made to select 20 cells to the right, on row?

Range(ActiveCell, Cells(ActiveCell.Row + 20, ActiveCell.Column)).Select

Can this be done?
Thanks!

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
move from active cell offset in macro april Excel Discussion (Misc queries) 5 October 18th 09 05:02 PM
Active cell position for macro MechEng Excel Worksheet Functions 3 September 24th 07 01:44 PM
how to create a macro that references the currently active cell Kurt Excel Worksheet Functions 2 December 13th 06 05:49 PM
copy name from active sheet to cell - using macro or function dymek Excel Worksheet Functions 2 October 2nd 06 12:32 PM
macro- move down to empty cell & active worksheet EducatingMom Excel Worksheet Functions 3 August 4th 06 11:02 PM


All times are GMT +1. The time now is 03:36 AM.

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

About Us

"It's about Microsoft Excel"