Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 55
Default Selection.Resize error

I want to starting at a single cell selection, offset two columns and
expand the selection two two cells.
So far I am using:

ActiveCell.Offset(0, 2).Select

Selection.Resize(0, 2).Select

However, I get the runtime error: Application-defined or
object-defined error

Probably just another case of me using something in the wrong place but
I cant see what else to do.

Any help will be appreciated.

Robert

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 55
Default Selection.Resize error


wrote:
I want to starting at a single cell selection, offset two columns and
expand the selection two two cells.
So far I am using:

ActiveCell.Offset(0, 2).Select

Selection.Resize(0, 2).Select

However, I get the runtime error: Application-defined or
object-defined error

Probably just another case of me using something in the wrong place but
I cant see what else to do.

Any help will be appreciated.

Robert


I forgot to say that when I start the code, I have a cell selected and
the error occurs on the second line of code

R

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,311
Default Selection.Resize error

I'm not sure exactly what you want to do. What are you trying to do with
'Resize '?

If you just want to expand your selection to two cells after you offset two
columns, which two cells should be the selection.
Assuming adjacent columns:

ActiveCell.Offset(0, 2).Select
Range(ActiveCell, ActiveCell.Offset(0, 1)).Select

If you mean you want the two cells to be merged, then maybe:

ActiveCell.Offset(0, 2).Select
Range(ActiveCell, ActiveCell.Offset(0, 1)).Select
Selection.Merge

Regards,
Paul


wrote in message
ups.com...

wrote:
I want to starting at a single cell selection, offset two columns and
expand the selection two two cells.
So far I am using:

ActiveCell.Offset(0, 2).Select

Selection.Resize(0, 2).Select

However, I get the runtime error: Application-defined or
object-defined error

Probably just another case of me using something in the wrong place but
I cant see what else to do.

Any help will be appreciated.

Robert


I forgot to say that when I start the code, I have a cell selected and
the error occurs on the second line of code

R



  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7,247
Default Selection.Resize error

The problem is the 0 in the resize property. This tells Excel you want to
resize the range to 0 rows high. You can't have a range with 0 rows.


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
www.cpearson.com
(email address is on the web site)

wrote in message
ups.com...

wrote:
I want to starting at a single cell selection, offset two columns and
expand the selection two two cells.
So far I am using:

ActiveCell.Offset(0, 2).Select

Selection.Resize(0, 2).Select

However, I get the runtime error: Application-defined or
object-defined error

Probably just another case of me using something in the wrong place but
I cant see what else to do.

Any help will be appreciated.

Robert


I forgot to say that when I start the code, I have a cell selected and
the error occurs on the second line of code

R





  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 55
Default Selection.Resize error

Ahh, the light bulb is on Chip! The education continues
Thanks to all who replied
Robert

Chip Pearson wrote:
The problem is the 0 in the resize property. This tells Excel you want to
resize the range to 0 rows high. You can't have a range with 0 rows.


  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,600
Default Selection.Resize error

Selection.Offset(0, 2).Resize(2, 1).Select

The 'size' of a range must always be 1 or more rows and columns within the
limits of the sheet size.

Regards,
Peter T

wrote in message
ups.com...
I want to starting at a single cell selection, offset two columns and
expand the selection two two cells.
So far I am using:

ActiveCell.Offset(0, 2).Select

Selection.Resize(0, 2).Select

However, I get the runtime error: Application-defined or
object-defined error

Probably just another case of me using something in the wrong place but
I cant see what else to do.

Any help will be appreciated.

Robert



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
Selection Error [email protected] Excel Programming 4 July 31st 06 09:39 PM
I could NOT resize the axis title but excel allows me to resize gr Iwan Setiyono Ko Charts and Charting in Excel 4 June 6th 06 04:46 AM
I could NOT resize the axis title but excel allows me to resize gr Iwan Setiyono Ko Charts and Charting in Excel 0 March 15th 06 10:34 AM
Resize selection made by "name" VBA spydor Excel Discussion (Misc queries) 2 January 26th 06 07:37 AM
Selection.Sort error Krager Excel Programming 3 September 3rd 05 06:12 PM


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