Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
spydor
 
Posts: n/a
Default Resize selection made by "name" VBA


Hi...Thanks for your help!!!

The problem is thussly.....

I have selected a range by "name" and I need to delete some of it's
contents without losing the top and bottom lines which are the location
lines for finding the "name" range. Got any clean, simple ways to do
this????
Thanks....
Spydor


--
spydor
------------------------------------------------------------------------
spydor's Profile: http://www.excelforum.com/member.php...o&userid=28438
View this thread: http://www.excelforum.com/showthread...hreadid=505183

  #2   Report Post  
Posted to microsoft.public.excel.misc
Dave Peterson
 
Posts: n/a
Default Resize selection made by "name" VBA

Without knowing too much...

Dim myRng As Range
Dim iRow As Long

Set myRng = Worksheets("sheet1").Range("testrng")

'keep first and last
For iRow = myRng.Rows.Count - 1 To 2 Step -1
myRng.Rows(iRow).EntireRow.Delete
Next iRow




spydor wrote:

Hi...Thanks for your help!!!

The problem is thussly.....

I have selected a range by "name" and I need to delete some of it's
contents without losing the top and bottom lines which are the location
lines for finding the "name" range. Got any clean, simple ways to do
this????
Thanks....
Spydor

--
spydor
------------------------------------------------------------------------
spydor's Profile: http://www.excelforum.com/member.php...o&userid=28438
View this thread: http://www.excelforum.com/showthread...hreadid=505183


--

Dave Peterson
  #3   Report Post  
Posted to microsoft.public.excel.misc
paul
 
Posts: n/a
Default Resize selection made by "name" VBA

knowing MUCH less than David,have you seen the VBA resize property

Resize Property
Resizes the specified range. Returns a Range object that represents the
resized range.

expression.Resize(RowSize, ColumnSize)
expression Required. An expression that returns a Range object to be
resized.

RowSize Optional Variant. The number of rows in the new range. If this
argument is omitted, the number of rows in the range remains the same.

ColumnSize Optional Variant. The number of columns in the new range. If
this argument is omitted, the number of columns in the range remains the same.

Example
This example resizes the selection on Sheet1 to extend it by one row and one
column.

Worksheets("Sheet1").Activate
numRows = Selection.Rows.Count
numColumns = Selection.Columns.Count
Selection.Resize(numRows + 1, numColumns

--
paul
remove nospam for email addy!



"Dave Peterson" wrote:

Without knowing too much...

Dim myRng As Range
Dim iRow As Long

Set myRng = Worksheets("sheet1").Range("testrng")

'keep first and last
For iRow = myRng.Rows.Count - 1 To 2 Step -1
myRng.Rows(iRow).EntireRow.Delete
Next iRow




spydor wrote:

Hi...Thanks for your help!!!

The problem is thussly.....

I have selected a range by "name" and I need to delete some of it's
contents without losing the top and bottom lines which are the location
lines for finding the "name" range. Got any clean, simple ways to do
this????
Thanks....
Spydor

--
spydor
------------------------------------------------------------------------
spydor's Profile: http://www.excelforum.com/member.php...o&userid=28438
View this thread: http://www.excelforum.com/showthread...hreadid=505183


--

Dave Peterson

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
Add "left align across selection" cell formatting Monty Analyst Excel Worksheet Functions 2 November 5th 08 03:17 PM
Max Value in a column exclude selection - Excel VBA magix Excel Discussion (Misc queries) 3 November 5th 05 09:18 PM
Cell Selection after "Enter" Synectica Excel Discussion (Misc queries) 6 August 29th 05 09:55 PM
XL 03:Side by side windows: as you resize one workbook, the other. White bellied Excel Discussion (Misc queries) 1 April 25th 05 08:52 PM
Choices made available dependent on another selection? Miss Spaghetti Excel Worksheet Functions 1 April 21st 05 01:58 AM


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