Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I need to create a macro that will find the max value in a column and use
that value to select a userform. The worksheet with the data is called "Raw Data". In column A, the data could look like 1,2,3,4,5,6,7,8,9,10,11,12. I want to find the max value (12) and have the macro select UserForm12. The max value (in this case 12) will also be used to select the appropriate worksheet for UserForm12 which will be "Logsheet12". This will OPEN the appropriate userform and loghseet. The other worksheets will be hidden from the user. Excuse the redundancy |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Try something like this. I used the worksheet function max and then used a
case select based on the max value. Sub maxvalue() Lastrow = Cells(Rows.Count, "A").End(xlUp).Row Set maxrange = Range(Cells(1, "A"), Cells(Lastrow, "A")) maximumvalue = WorksheetFunction.Max(maxrange) Select Case maximumvalue Case 12 Worksheets("Logsheet12").Activate End Select End Sub "cj2k2k" wrote: I need to create a macro that will find the max value in a column and use that value to select a userform. The worksheet with the data is called "Raw Data". In column A, the data could look like 1,2,3,4,5,6,7,8,9,10,11,12. I want to find the max value (12) and have the macro select UserForm12. The max value (in this case 12) will also be used to select the appropriate worksheet for UserForm12 which will be "Logsheet12". This will OPEN the appropriate userform and loghseet. The other worksheets will be hidden from the user. Excuse the redundancy |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Find Select Macro | Excel Programming | |||
Lopp in column to find and select | Excel Programming | |||
Call Userfor and click button with macro | Excel Programming | |||
Find Last Column, Select, and Bold | Excel Programming | |||
How to find a value then select that column | Excel Programming |