Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Recording Macro -- find max value --- create chart


I am trying to record a macro that finds the maximum value in a gri
file.

Basically, I have this huge worksheet, with lots and lots of column
and rows (maybe 1000x100). I have more than a thousand worksheets, so
need to create a macro!

- I need to find the max value in the worksheet (cell location change
per worksheet, obviously).

- I need to take the row that the max value cell is located.
- Take this row and set it as the y-values for a chart, and se
1,2,3...n for x-values for the chart

- Repeat steps above to find the column containing the same max valu
cell... create y-values with this and 1,2,3...n for x-values.

How do I do this??

-----------------------------------------------
~~ Message posted from http://www.ExcelTip.com
~~View and post usenet messages directly from http://www.ExcelForum.com

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 62
Default Recording Macro -- find max value --- create chart

Hi nkob,

You can use WorksheetFunction.Max and Find method.
Question:
Doesn't the number inputted overlap?

Sub Test()
Dim rngTarget As Range, rngFound As Range, firstAddress As String
Set rngTarget = Range(Cells(1, 1), Cells(1000, 100))
Set rngFound = rngTarget.Find(WorksheetFunction.Max(rngTarget), , ,
xlWhole)
If Not rngFound Is Nothing Then
firstAddress = rngFound.Address
Do
MsgBox rngFound.Address(0, 0)
Set rngFound = rngTarget.FindNext(rngFound)
Loop While Not rngFound Is Nothing And rngFound.Address <
firstAddress
End If
Set rngTarget = Nothing: Set rngFound = Nothing
End Sub

Colo

"nkob" wrote in message
...

I am trying to record a macro that finds the maximum value in a grid
file.

Basically, I have this huge worksheet, with lots and lots of columns
and rows (maybe 1000x100). I have more than a thousand worksheets, so I
need to create a macro!

- I need to find the max value in the worksheet (cell location changes
per worksheet, obviously).

- I need to take the row that the max value cell is located.
- Take this row and set it as the y-values for a chart, and set
1,2,3...n for x-values for the chart

- Repeat steps above to find the column containing the same max value
cell... create y-values with this and 1,2,3...n for x-values.

How do I do this???


------------------------------------------------
~~ Message posted from http://www.ExcelTip.com/
~~View and post usenet messages directly from http://www.ExcelForum.com/


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Recording find Maros gwtechie72 New Users to Excel 1 January 23rd 08 10:09 PM
Create a macro which can find a record in three books sand Excel Worksheet Functions 4 May 25th 07 04:18 AM
My excel macro recorder no longer shows up when recording macro jack Excel Discussion (Misc queries) 1 February 5th 07 09:31 PM
My excel macro recorder no longer shows up when recording macro jack Excel Discussion (Misc queries) 3 February 5th 07 08:22 PM
Can't find cell ref. when recording a macro in excel Vinod Lala Excel Discussion (Misc queries) 3 May 23rd 06 06:59 AM


All times are GMT +1. The time now is 07:12 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"