Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,441
Default select cell after sorting

Steve,

As long as the new value is unique: otherwise, this will pick up the first instance.

Private Sub Worksheet_Change(ByVal Target As Range)
Dim myVal As Variant
myVal = Target.Value

Columns("A:A").Select
Selection.Sort Key1:=Range("A1"), Order1:=xlAscending, Header:=xlGuess, _
OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom, _
DataOption1:=xlSortNormal
Range("A:A").Find(myVal).Select

End Sub

Of course, you can get around that limitation, but it requires more work....

HTH,
Bernie
MS Excel MVP


"Steve" wrote in message
...
Private Sub Worksheet_Change(ByVal Target As Range)

Columns("A:A").Select
Selection.Sort Key1:=Range("A1"), Order1:=xlAscending, Header:=xlGuess, _
OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom, _
DataOption1:=xlSortNormal
Range("a1").Select



End Sub

Easy enough. I wanted the spread sheet to sort the column by ascending once
the user enters new data. I also want the new data to be the active selection
after it has been sorted. Does anyone know how I can do this? Thanks.



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
VBA: Column Select then Data Select then return to cell A1 James C[_2_] Excel Discussion (Misc queries) 3 February 1st 10 11:35 AM
Select all columns with data for sorting. jen907 Excel Discussion (Misc queries) 2 June 29th 09 08:06 PM
Select same cell after sorting Sandy Excel Programming 2 October 23rd 08 02:17 PM
Using formulas to select cells (Ex: Select every nth cell in a col Lakeview Photographic Services Excel Discussion (Misc queries) 2 March 15th 07 02:17 PM
Select Case for Sorting / Grouping Columns Bettergains Excel Programming 2 February 25th 05 08:35 PM


All times are GMT +1. The time now is 07:55 PM.

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"