http://www.excelforum.com/showthread.php?t=649091Originally Posted by modytrane
This is exactly what I'm looking for; but, how can I apply this to my worksheet? I don't see how it has been done! LOL
http://www.excelforum.com/showthread.php?t=649091Originally Posted by modytrane
This is exactly what I'm looking for; but, how can I apply this to my worksheet? I don't see how it has been done! LOL
Last edited by VBA Noob; 07-08-2008 at 04:25 PM.
Hi Vbort44,
Have you put the code on the Worksheet_Change event of your tab in question as modytrane has?
HTH
Robert
No, I haven't done anything. I'm not sure where to start...Could you offer some guidance?Originally Posted by Trebor76
Hi Vbort44,
See if the following five steps does the job:
1. Copy (Ctrl + C) the following code which modytrane has developed to the clipboard:
2. Right click on the tab name you wish to have the code run on and from the shortcut menu, select (click) on View Code![]()
Please Login or Register to view this content.
3. Paste (Ctrl + V) the code from step 1 in the blank module and adjust the ranges in the code as required
4. From the File menu select Close and Return to Microsoft Excel
5. Try it
HTH
Robert
Mt tab is set up differently and I am going to have to edit the code. What does the Range("A6"), and Range("C2").Select mean?
Last edited by shg; 07-09-2008 at 12:45 AM. Reason: Deleted spurious quote.
Basically it is selecting those cells. Just like if you were to use your mouse and click on a cell.Originally Posted by Vbort44
eg:
Range("C2").Select
This means to select cell c2.
ie click on cell "c2".
Hi Vbort44,
Range("A6") is the reference cell as how the data in the Range("A6:E17") is to be sorted (descending sequence in this instance). Range("C2").Select is simply where the cursor ends up after the code has run.
This is not at all dynamic as is this code I wrote for you earlier.
HTH
Robert
Vbort, vaneagle, please do the forum a favor and quit quoting posts in responses. It's unnecessary clutter.
Okay Trebor, I get it now.
But I'm still having some problems. The data that I'm trying to sort is linked in from another work book and it doesn't seem to want to sort the data unless the values are pasted special, values only.
Not sure as sorting should work on formulas as well as values![]()
Ah, okay, it works now. But it only works when I make a change to the page, not when my data is simply updated from another worksheet.
I'd say that's because the Worksheet_Change event only executes on direct user changes not from simply updating a link as every existing cell value would have to be stored then referred back to. You could try changing this line of code...
...to![]()
Please Login or Register to view this content.
though it may become cumbersome and/or frustrating if you have a number of formulas on the tab in question.![]()
Please Login or Register to view this content.
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks