Macro - Data Sort -Variable Selection

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi all!!!

I am trying to get my macro to run a sort in a non specific cell for column
D.....there are many steps up to this point, I will include the last couple
in the code...here is what I have so far....

Columns("C:C").Find(What:="x").EntireRow.Insert
Columns("C:C").Find(What:="x").EntireRow.Select
Range(Selection, Selection.End(xlDown)).Select
Range(Selection, Selection.End(xlToRight)).Select
Selection.Sort Key1:=Range("D63"), Order1:=xlAscending, Header:=xlGuess, _
OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom

Instead of the range being specific for D63, I want it to select the D
column after if finds X to the end of the wkst. Any ideas on how I can
accomplish this???

Thanks in advance......
 
..Sort is pretty forgiving. Didn't it work using D63?

I've used:

....key1:=range("d:d"), ...

And that works, too.
 
Selecting "d:d" works, but it will select the whole column... I only want to
sort the selection after I find x and sort that....
 
Don't select column D.

But do use it in the key1:=range("d:d") portion.

Then what happens?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top