Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.misc
|
|||
|
|||
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
Posted to microsoft.public.excel.misc
|
|||
|
|||
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
Posted to microsoft.public.excel.misc
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Add "left align across selection" cell formatting | Excel Worksheet Functions | |||
Max Value in a column exclude selection - Excel VBA | Excel Discussion (Misc queries) | |||
Cell Selection after "Enter" | Excel Discussion (Misc queries) | |||
XL 03:Side by side windows: as you resize one workbook, the other. | Excel Discussion (Misc queries) | |||
Choices made available dependent on another selection? | Excel Worksheet Functions |