ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   simple reszie (https://www.excelbanter.com/excel-programming/442984-simple-reszie.html)

MikeF[_2_]

simple reszie
 

Would like to take a range and resize it by 2 columns less on the right and
one column less on the bottom.

Any assistance will be greatly appreciated.
Thanx.

-Mike

Gary''s Student

simple reszie
 
Perhaps:

Sub dural()
Selection.Resize(Selection.Rows.Count - 1, Selection.Columns.Count - 2).Select
End Sub
--
Gary''s Student - gsnu201003

Per Jessen[_2_]

simple reszie
 
Hi Mike

It is not much information you give us to work with.

In my example, the selected range, will be reduced by 1 row and by two
columns:

Sub ResizeRng()
Dim rng As Range
Set rng = Selection
Set rng = rng.Resize(rng.Rows.Count - 1, rng.Columns.Count - 2)
rng.Select
End Sub


Regards,
Per

On 31 Maj, 20:45, MikeF wrote:
Would like to take a range and resize it by 2 columns less on the right and
one column less on the bottom.

Any assistance will be greatly appreciated.
Thanx.

*-Mike



Wouter HM

simple reszie
 
Hi Mike,

In Excel 2003 I have created this:

Sub Min1Row2Cols()
Dim rngMine As Range
Dim lngRow As Long
Dim lngCol As Long

If Selection.Rows.Count 1 And _
Selection.Columns.Count 2 Then
lngRow = Selection.Rows.Count - 1
lngCol = Selection.Columns.Count - 2

Set rngMine = Range(Selection.Cells(1, 1), _
Selection.Cells(lngRow, lngCol))
rngMine.Select
End If
End Sub

HTH

Wouter


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

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com