Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
This will find the first occurrence of MAX in column A and resize the area
by 4 more columns. Change the +4 as needed: Sub test() Dim MyRng As Range Dim MyMax As Double Dim LRow As Long LRow = Cells(Rows.Count, 1).End(xlUp).Row Set MyRng = Range("A1:A" & LRow) MyMax = Application.WorksheetFunction.Max(MyRng) LRow = Cells.Find(MyMax).Row Set MyRng = Range("A1:A" & LRow) Set MyRng = MyRng.Resize(MyRng.Rows.Count, MyRng.Columns.Count + 4) MyRng.Select ,select is optional End Sub Mike F "piotr-unia" wrote in message oups.com... I would like to set an area in spreadsheet e.g. from A1 to maximum value within the same column. How to express in vba the following operation? Please help me, I didn.t find it in my vba manual. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Can we find the stating date of the week in Excel or ms access? | Excel Discussion (Misc queries) | |||
WEEKNUM calculations for week stating with Tuesday | Excel Worksheet Functions | |||
Comparing & Stating The Nearest Matching | Excel Discussion (Misc queries) | |||
My IF statement is stating False but if I manual calculate it it | Excel Discussion (Misc queries) | |||
Stating ranges in formulae | Excel Programming |