Hi...Thanks for your help!!!
The problem is thussly.....
I have selected a range by quot;namequot; 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 quot;namequot; range. Got any clean, simple ways to do
this????
Thanks....
Spydor--
spydor
------------------------------------------------------------------------
spydor's Profile: www.excelforum.com/member.php...oamp;userid=28438
View this thread: www.excelforum.com/showthread...hreadid=505183Without knowing too much...
Dim myRng As Range
Dim iRow As Long
Set myRng = Worksheets(quot;sheet1quot;).Range(quot;testrngquot;)
'keep first and last
For iRow = myRng.Rows.Count - 1 To 2 Step -1
myRng.Rows(iRow).EntireRow.Delete
Next iRow
spydor wrote:
gt;
gt; Hi...Thanks for your help!!!
gt;
gt; The problem is thussly.....
gt;
gt; I have selected a range by quot;namequot; and I need to delete some of it's
gt; contents without losing the top and bottom lines which are the location
gt; lines for finding the quot;namequot; range. Got any clean, simple ways to do
gt; this????
gt; Thanks....
gt; Spydor
gt;
gt; --
gt; spydor
gt; ------------------------------------------------------------------------
gt; spydor's Profile: www.excelforum.com/member.php...oamp;userid=28438
gt; View this thread: www.excelforum.com/showthread...hreadid=505183
--
Dave Peterson
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(quot;Sheet1quot;).Activate
numRows = Selection.Rows.Count
numColumns = Selection.Columns.Count
Selection.Resize(numRows 1, numColumns
--
paul
remove nospam for email addy!
quot;Dave Petersonquot; wrote:
gt; Without knowing too much...
gt;
gt; Dim myRng As Range
gt; Dim iRow As Long
gt;
gt; Set myRng = Worksheets(quot;sheet1quot;).Range(quot;testrngquot;)
gt;
gt; 'keep first and last
gt; For iRow = myRng.Rows.Count - 1 To 2 Step -1
gt; myRng.Rows(iRow).EntireRow.Delete
gt; Next iRow
gt;
gt;
gt;
gt;
gt; spydor wrote:
gt; gt;
gt; gt; Hi...Thanks for your help!!!
gt; gt;
gt; gt; The problem is thussly.....
gt; gt;
gt; gt; I have selected a range by quot;namequot; and I need to delete some of it's
gt; gt; contents without losing the top and bottom lines which are the location
gt; gt; lines for finding the quot;namequot; range. Got any clean, simple ways to do
gt; gt; this????
gt; gt; Thanks....
gt; gt; Spydor
gt; gt;
gt; gt; --
gt; gt; spydor
gt; gt; ------------------------------------------------------------------------
gt; gt; spydor's Profile: www.excelforum.com/member.php...oamp;userid=28438
gt; gt; View this thread: www.excelforum.com/showthread...hreadid=505183
gt;
gt; --
gt;
gt; Dave Peterson
gt;
- Dec 25 Tue 2007 20:41
Resize selection made by quot;namequot; VBA
close
全站熱搜
留言列表
發表留言