Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
AK AK is offline
external usenet poster
 
Posts: 56
Default RESIZE USEDRANGE

Please help.

I want to select the used range with the first 1 row not to select.
If I use the Offset to select :-
Selection.Offset(1,0).Select
The range will be down 1 row and an empty row after the last used row will
also be selected
If I use the resize:-
Selection.Resize(numRows -1, numColumns).Select
The last used row will be deselected.

What exactly should I write ?

Thanks in advance

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 74
Default RESIZE USEDRANGE

Hi ak,

You are close:

Dim numRows As Integer
Dim numColumns As Integer
numRows = Selection.Rows.Count
numColumns = Selection.Columns.Count
Selection.Offset(1, 0).Resize(numRows - 1, numColumns).Select

HTH

Executor

  #3   Report Post  
Posted to microsoft.public.excel.programming
AK AK is offline
external usenet poster
 
Posts: 56
Default RESIZE USEDRANGE

Hi Executor,

It works.

Thanks again.

"Executor" 來函:

Hi ak,

You are close:

Dim numRows As Integer
Dim numColumns As Integer
numRows = Selection.Rows.Count
numColumns = Selection.Columns.Count
Selection.Offset(1, 0).Resize(numRows - 1, numColumns).Select

HTH

Executor


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
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
usedRange GC Excel Programming 2 March 31st 05 01:44 PM
usedrange Mike[_94_] Excel Programming 4 February 17th 05 03:59 PM
Usedrange Terry VanDuzee Excel Programming 6 August 10th 03 05:57 PM


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

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"