Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 14
Default Permanent formula?

I have an autosort code in my spreadsheet, but one of the cells that the sort
criteria is based off of is meant to be an average of 5 other cells. When the
line is shuffled into place into the spreadsheet, the formula is lost. I want
to retain that though because the sort is meant to base off of an overall
average. Can somebody help? Here is my current formula (G2 is the cell that
averages A2:F2).

Private Sub Worksheet_Change(ByVal Target As Range)
If Intersect(Target, Range("S2")) Is Nothing Then
Exit Sub
End If

Application.EnableEvents = False
Columns("A:S").Sort _
Key1:=Range("G2"), order1:=xlDescending, _
Key2:=Range("k2"), order2:=xlDescending, _
Key3:=Range("l2"), order3:=xlDescending, _
header:=xlYes

Range("A2:S2").Insert Shift:=xlDown
Application.EnableEvents = True
End Sub

  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 35,218
Default Permanent formula?

Check your other thread.

Orangepegs wrote:

I have an autosort code in my spreadsheet, but one of the cells that the sort
criteria is based off of is meant to be an average of 5 other cells. When the
line is shuffled into place into the spreadsheet, the formula is lost. I want
to retain that though because the sort is meant to base off of an overall
average. Can somebody help? Here is my current formula (G2 is the cell that
averages A2:F2).

Private Sub Worksheet_Change(ByVal Target As Range)
If Intersect(Target, Range("S2")) Is Nothing Then
Exit Sub
End If

Application.EnableEvents = False
Columns("A:S").Sort _
Key1:=Range("G2"), order1:=xlDescending, _
Key2:=Range("k2"), order2:=xlDescending, _
Key3:=Range("l2"), order3:=xlDescending, _
header:=xlYes

Range("A2:S2").Insert Shift:=xlDown
Application.EnableEvents = True
End Sub


--

Dave Peterson
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
Find value in array Brook6 Excel Worksheet Functions 26 January 30th 07 09:40 PM
Reusing formula Tony29 Excel Discussion (Misc queries) 7 September 7th 06 03:34 AM
Making a column of numbers created from a formula permanent. jba919 Excel Worksheet Functions 2 August 1st 06 07:25 PM
Match then lookup Tenacity Excel Worksheet Functions 9 December 3rd 05 05:30 AM
How do change formula to permanent data? Wendron Gordon Excel Discussion (Misc queries) 3 May 3rd 05 05:42 PM


All times are GMT +1. The time now is 08:23 AM.

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"