View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
tx12345
 
Posts: n/a
Default Allowing for variable cell reference in macro


Hi

What I'd like to figure out is how to get a macro to read from data
placed in a cell, and then apply that data to the macro.

like:

Sub Macro1()

Range("TBD<<").Select
Selection.sort Key1:=Range("I1"), Order1:=xlAscending,
Header:=xlGuess, _
OrderCustom:=1, MatchCase:=False

End Sub


where the range is read from some other cell on the spreadsheet. so the
macro reads what is in the cell telling it what range to sort, and then
enters that in the Range("").Select area of the macro.

Otherwise I have to create a separate macro for every area that might
possibly apply. I'd like to create an intelligent macro that I tell
what range to sort, or delete, or copy, or paste, etc, whatever I want
to happen with the range of cells I select.

Any ideas?

Thx


--
tx12345
------------------------------------------------------------------------
tx12345's Profile: http://www.excelforum.com/member.php...o&userid=24776
View this thread: http://www.excelforum.com/showthread...hreadid=495872