Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]() 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 |
#2
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
Let's say that A1 contains the text Z100, the following:
Sub Macro1() Dim s As String s = Cells(1, 1) Range(s).Select End Sub will get the contents of A1 (as a string) convert it into a range and select that range. You could apply it to ranges of more than one cell. -- Gary's Student "tx12345" wrote: 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 |
#3
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]() nothing like a simple solution. many thanks! -- tx12345 ------------------------------------------------------------------------ tx12345's Profile: http://www.excelforum.com/member.php...o&userid=24776 View this thread: http://www.excelforum.com/showthread...hreadid=495872 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Maintaining cell reference after sorting | Excel Discussion (Misc queries) | |||
how do I format a cell reference to move as source changes | Excel Worksheet Functions | |||
copying cell names | Excel Discussion (Misc queries) | |||
Copy cell format to cell on another worksht and update automatical | Excel Worksheet Functions | |||
GET.CELL | Excel Worksheet Functions |