To Macro or not.

philipt

New Member
Joined
Mar 31, 2013
Messages
5
I have a page that I have written a macro for. It works great on my computer, but makes theirs stall. I think I can accomplish the same results without using a macro. I have a link to the excel document below but my macro is:

Private Sub Worksheet_Calculate()
Set Target = Sheet3.Range("A5:J29").SpecialCells(xlCellTypeFormulas)
Range("A5:J29").Sort _
Key1:=Range("J6"), _
Order1:=xlAscending, _
Header:=xlYes, _
OrderCustom:=1, _
MatchCase:=False, _
Orientation:=xlTopToBottom, _
DataOption1:=xlSortNormal
End Sub

Is there something wrong with this macro? Otherwise, Can someone recommend a way to have it sort by the MBAverage perhaps using the Small or Large code. I was using =VLOOKUP($J6,data,COLUMN(A1),FALSE) and made a data table on a sheet to hide, but I always got an #NA error.

http://www.philterry.net/new.xls


Thanks,
Phil
 

Excel Facts

Lock one reference in a formula
Need 1 part of a formula to always point to the same range? use $ signs: $V$2:$Z$99 will always point to V2:Z99, even after copying
I wish to automatically sort a sheet based on either an amount in the "Market Basket Average" column of my work sheet or the "Rank" column of my worksheet. There are 8 columns that go along with the data that needs sorted. I added the Rank column to make writing my vbscript easier but if I don't need that column, it can be removed.
 
Upvote 0

Forum statistics

Threads
1,203,456
Messages
6,055,543
Members
444,794
Latest member
HSAL

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top