Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
RunsWithKnives
 
Posts: n/a
Default Macro to find copy "header" and paste

Hi Folks,
This may sound easy but it has stumped me.
I have a list of max values at the end of a row of 48 columns. I want to
find that max value within the row and then copy and paste the header (first
row) for the column the max value appears within. I cannot use a LOOKUP
function as the data is not sorted and has too many fields to use an if
statement.

Cheers,
RunsWithKnives
  #2   Report Post  
Posted to microsoft.public.excel.misc
Biff
 
Posts: n/a
Default Macro to find copy "header" and paste

Hi!

Row 1 are column headers, A1:AV1

A2:AV2 = values

AW2 = =MAX(A2:AV2)

Find the corresponding header:

=INDEX(A$1:AV$1,MATCH(AW2,A2:AV2,0))

If there are duplicate max values the hearder for the first match (left to
right) will be returned.

Biff

"RunsWithKnives" wrote in message
...
Hi Folks,
This may sound easy but it has stumped me.
I have a list of max values at the end of a row of 48 columns. I want to
find that max value within the row and then copy and paste the header
(first
row) for the column the max value appears within. I cannot use a LOOKUP
function as the data is not sorted and has too many fields to use an if
statement.

Cheers,
RunsWithKnives



  #3   Report Post  
Posted to microsoft.public.excel.misc
RunsWithKnives
 
Posts: n/a
Default Macro to find copy "header" and paste

Hey Cheers Biff,
that does the trick and I don't have to punt about with macros.

Thanks a bunch,

RunsWithKnives


"Biff" wrote:

Hi!

Row 1 are column headers, A1:AV1

A2:AV2 = values

AW2 = =MAX(A2:AV2)

Find the corresponding header:

=INDEX(A$1:AV$1,MATCH(AW2,A2:AV2,0))

If there are duplicate max values the hearder for the first match (left to
right) will be returned.

Biff

"RunsWithKnives" wrote in message
...
Hi Folks,
This may sound easy but it has stumped me.
I have a list of max values at the end of a row of 48 columns. I want to
find that max value within the row and then copy and paste the header
(first
row) for the column the max value appears within. I cannot use a LOOKUP
function as the data is not sorted and has too many fields to use an if
statement.

Cheers,
RunsWithKnives




  #4   Report Post  
Posted to microsoft.public.excel.misc
Biff
 
Posts: n/a
Default Macro to find copy "header" and paste

You're welcome. Thanks for the feedback!

Biff

"RunsWithKnives" wrote in message
...
Hey Cheers Biff,
that does the trick and I don't have to punt about with macros.

Thanks a bunch,

RunsWithKnives


"Biff" wrote:

Hi!

Row 1 are column headers, A1:AV1

A2:AV2 = values

AW2 = =MAX(A2:AV2)

Find the corresponding header:

=INDEX(A$1:AV$1,MATCH(AW2,A2:AV2,0))

If there are duplicate max values the hearder for the first match (left
to
right) will be returned.

Biff

"RunsWithKnives" wrote in
message
...
Hi Folks,
This may sound easy but it has stumped me.
I have a list of max values at the end of a row of 48 columns. I want
to
find that max value within the row and then copy and paste the header
(first
row) for the column the max value appears within. I cannot use a LOOKUP
function as the data is not sorted and has too many fields to use an if
statement.

Cheers,
RunsWithKnives






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
Macro to find, copy, and paste until value change Valerie Excel Worksheet Functions 4 January 26th 06 04:10 AM
Search, Copy, Paste Macro in Excel [email protected] Excel Worksheet Functions 0 January 3rd 06 06:51 PM
Macro to open workbook and copy and paste values in to orig workbo Dena X Excel Worksheet Functions 1 December 15th 05 11:13 PM
Copy & Paste macro sparx Excel Worksheet Functions 3 September 13th 05 05:08 AM
Copy Paste Special Macro Bud Hughes Excel Discussion (Misc queries) 2 August 31st 05 02:00 AM


All times are GMT +1. The time now is 05:38 AM.

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

About Us

"It's about Microsoft Excel"