Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 15
Default How do I use the .Cells property to refer to ActiveCell?

Had a few problems with your code, but you answered my question. I was
inputting the key value wrong. Thanks for the help.

"TomPl" wrote:

I'm not sure the point to all of this, but the following should do what you
have described. This will sort the data in columns A thru N based on the
value in column A. Only rows 4 thru the row of the active cell will be
sorted.

Sub SortSelection()

Dim rngCell As String

rngCell = ActiveCell.Row

ActiveSheet.Range("A3:N" & rngCell).Sort Key1:=Range("a4"),
Order1:=xlAscending, Header:= _
xlGuess, OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom, _
DataOption1:=xlSortNormal
ActiveSheet.Range("A" & rngCell).Select

End Sub

Hope'n this works.

Tom

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
how to find cells that refer to data in other cells in excel Aman Excel Discussion (Misc queries) 8 December 2nd 07 10:02 PM
If activecell.column = variable then activecell,offset (0,1) Battykoda via OfficeKB.com Excel Discussion (Misc queries) 1 October 2nd 07 08:05 PM
Using cells to refer to worksheets Rup1776 Excel Worksheet Functions 1 September 27th 06 09:36 AM
Why do some Excel cells refer to e-mail? Fred in Keswick Excel Worksheet Functions 1 February 28th 06 10:09 PM
To get a lot of charts that refer to different cells Anderson Lee Charts and Charting in Excel 1 December 28th 04 02:35 PM


All times are GMT +1. The time now is 10:14 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"