Help Organizing Data

Demni009

New Member
Joined
Mar 5, 2014
Messages
22
Hi all,

I am looking for some help. I wrote a macro that collects data from other spreadsheets saved in a certain file location. This macro runs great. I now want to be able to organize the data based on the values. I have tried the following line of code as a test to see if I can get a small amount of data on the sheet to organize.

Code:
SOSheet.Range("A1:A8").Sort key1:=Range("A1"), Order1:=xlDescending, Header:=xlYes

It turns out the code doesn't work and crashes my macro. The strange thing is, it does work in other macros. I can't figure out why.

If you need to see the rest of my code I would be happy to show you.

Thanks in advance for the help.

Cheers!
 

Excel Facts

Using Function Arguments with nested formulas
If writing INDEX in Func. Arguments, type MATCH(. Use the mouse to click inside MATCH in the formula bar. Dialog switches to MATCH.
SOSheet is defined as such.


Code:
Dim SOSheet As Worksheet

' Create a new workbook
        
        Set Book = Workbooks.Add
            With Book
                .Title = "Comp."
            End With


        Set SOSheet = ActiveWorkbook.Sheets("Sheet3")
 
Upvote 0

Forum statistics

Threads
1,215,443
Messages
6,124,890
Members
449,194
Latest member
JayEggleton

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