Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default VBA Macro ActiveCell.Offset

I am trying to find out why I am able to select a single cell Range in a
Macro but not a multi cell one. For example: ActiveCell.Offset(-2,
Counter1).Select This works. Single cell.
ActiveCell.Offset(-2, Counter1):ActiveCell.Offset(-1, Counter1).Select
This does not work. Multi cell, with or without enclosing end brackets.
Counter is the count in a For/Next loop.
I also tried using relative RC notation but had the same problem.
Your help would be appreciated.


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default VBA Macro ActiveCell.Offset

How about:

Range(ActiveCell.Offset(-2, Counter1), ActiveCell.Offset(-1, Counter1)).Select

Or even:

ActiveCell.Offset(-2, Counter1).Resize(2, 1).Select



Ted Mercer wrote:

I am trying to find out why I am able to select a single cell Range in a
Macro but not a multi cell one. For example: ActiveCell.Offset(-2,
Counter1).Select This works. Single cell.
ActiveCell.Offset(-2, Counter1):ActiveCell.Offset(-1, Counter1).Select
This does not work. Multi cell, with or without enclosing end brackets.
Counter is the count in a For/Next loop.
I also tried using relative RC notation but had the same problem.
Your help would be appreciated.


--

Dave Peterson
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10,593
Default VBA Macro ActiveCell.Offset

Range(ActiveCell.Offset(-2, Counter1),ActiveCell.Offset(-1,
Counter1)).Select

or

ActiveCell.Offset(-1, Counter1).Resize(2).Select

--
HTH

Bob Phillips

(replace somewhere in email address with gmail if mailing direct)

"Ted Mercer" wrote in message
...
I am trying to find out why I am able to select a single cell Range in a
Macro but not a multi cell one. For example: ActiveCell.Offset(-2,
Counter1).Select This works. Single cell.
ActiveCell.Offset(-2, Counter1):ActiveCell.Offset(-1, Counter1).Select
This does not work. Multi cell, with or without enclosing end brackets.
Counter is the count in a For/Next loop.
I also tried using relative RC notation but had the same problem.
Your help would be appreciated.




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
If activecell.column = variable then activecell,offset (0,1) Battykoda via OfficeKB.com Excel Discussion (Misc queries) 1 October 2nd 07 08:05 PM
ActiveCell Offset rnrss[_2_] Excel Programming 0 October 7th 05 10:12 AM
Activecell Offset Mark Excel Programming 2 December 7th 04 04:57 PM
ActiveCell.Offset w/ VBA Bob Umlas[_3_] Excel Programming 2 September 4th 04 02:58 PM
activecell offset rvik Excel Programming 1 December 24th 03 07:47 AM


All times are GMT +1. The time now is 04:41 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"