Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Macro conversion from Lotus 1-2-3 to Excel (Sort Macro)
I'm trying to create a Macro in Excel to do what my Lotus macro would do for
me. My Lotus macro did the following: 1) Goto to sheet A cell A1 2) It defined the data range to sort --- I had predefined data ranges which were included in the Macro. 3) Selection of Primary key by moving over from cell A1 to the column that contains the Primary key to sort by........ I would move 14 columns over. 4) Selection of Descending or Ascending and then execute Can data ranges be defined within the Excel Macro? I don't care if the macro does exactly what I was doing in Lotus so I'm open to any suggestions. I appreciate your help in advance!!! Thanks Carlos |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Macro conversion from Lotus 1-2-3 to Excel (Sort Macro)
Something like this is probably close...
sub Sort Stuff() Sheets("A").Range("A1:Z100").sort Key1:=range("N1"), Order1:=xlAscending, _ Header:=xlYes End sub -- HTH... Jim Thomlinson "cgsteel" wrote: I'm trying to create a Macro in Excel to do what my Lotus macro would do for me. My Lotus macro did the following: 1) Goto to sheet A cell A1 2) It defined the data range to sort --- I had predefined data ranges which were included in the Macro. 3) Selection of Primary key by moving over from cell A1 to the column that contains the Primary key to sort by........ I would move 14 columns over. 4) Selection of Descending or Ascending and then execute Can data ranges be defined within the Excel Macro? I don't care if the macro does exactly what I was doing in Lotus so I'm open to any suggestions. I appreciate your help in advance!!! Thanks Carlos |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Macro conversion from Lotus 1-2-3 to Excel (Sort Macro)
Jim,
Can the range be defined as a named range? Example: You put Sheets("A").Range("A1:Z100").......can it be Sheets("A").Range(data1) Data1 = would be the range name that defines "A1:Z100". If there is no Header, would the code be === Header:=xlNo ? Thanks Carlos "Jim Thomlinson" wrote: Something like this is probably close... sub Sort Stuff() Sheets("A").Range("A1:Z100").sort Key1:=range("N1"), Order1:=xlAscending, _ Header:=xlYes End sub -- HTH... Jim Thomlinson "cgsteel" wrote: I'm trying to create a Macro in Excel to do what my Lotus macro would do for me. My Lotus macro did the following: 1) Goto to sheet A cell A1 2) It defined the data range to sort --- I had predefined data ranges which were included in the Macro. 3) Selection of Primary key by moving over from cell A1 to the column that contains the Primary key to sort by........ I would move 14 columns over. 4) Selection of Descending or Ascending and then execute Can data ranges be defined within the Excel Macro? I don't care if the macro does exactly what I was doing in Lotus so I'm open to any suggestions. I appreciate your help in advance!!! Thanks Carlos |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Macro conversion from Lotus 1-2-3 to Excel (Sort Macro)
You are exactly correct on both counts...
-- HTH... Jim Thomlinson "cgsteel" wrote: Jim, Can the range be defined as a named range? Example: You put Sheets("A").Range("A1:Z100").......can it be Sheets("A").Range(data1) Data1 = would be the range name that defines "A1:Z100". If there is no Header, would the code be === Header:=xlNo ? Thanks Carlos "Jim Thomlinson" wrote: Something like this is probably close... sub Sort Stuff() Sheets("A").Range("A1:Z100").sort Key1:=range("N1"), Order1:=xlAscending, _ Header:=xlYes End sub -- HTH... Jim Thomlinson "cgsteel" wrote: I'm trying to create a Macro in Excel to do what my Lotus macro would do for me. My Lotus macro did the following: 1) Goto to sheet A cell A1 2) It defined the data range to sort --- I had predefined data ranges which were included in the Macro. 3) Selection of Primary key by moving over from cell A1 to the column that contains the Primary key to sort by........ I would move 14 columns over. 4) Selection of Descending or Ascending and then execute Can data ranges be defined within the Excel Macro? I don't care if the macro does exactly what I was doing in Lotus so I'm open to any suggestions. I appreciate your help in advance!!! Thanks Carlos |
#5
Posted to microsoft.public.excel.programming
|
|||
|
|||
Macro conversion from Lotus 1-2-3 to Excel (Sort Macro)
Sorry Data1 should be in quotes...
Sheets("A").Range("Data1"). ... -- HTH... Jim Thomlinson "Jim Thomlinson" wrote: You are exactly correct on both counts... -- HTH... Jim Thomlinson "cgsteel" wrote: Jim, Can the range be defined as a named range? Example: You put Sheets("A").Range("A1:Z100").......can it be Sheets("A").Range(data1) Data1 = would be the range name that defines "A1:Z100". If there is no Header, would the code be === Header:=xlNo ? Thanks Carlos "Jim Thomlinson" wrote: Something like this is probably close... sub Sort Stuff() Sheets("A").Range("A1:Z100").sort Key1:=range("N1"), Order1:=xlAscending, _ Header:=xlYes End sub -- HTH... Jim Thomlinson "cgsteel" wrote: I'm trying to create a Macro in Excel to do what my Lotus macro would do for me. My Lotus macro did the following: 1) Goto to sheet A cell A1 2) It defined the data range to sort --- I had predefined data ranges which were included in the Macro. 3) Selection of Primary key by moving over from cell A1 to the column that contains the Primary key to sort by........ I would move 14 columns over. 4) Selection of Descending or Ascending and then execute Can data ranges be defined within the Excel Macro? I don't care if the macro does exactly what I was doing in Lotus so I'm open to any suggestions. I appreciate your help in advance!!! Thanks Carlos |
#6
Posted to microsoft.public.excel.programming
|
|||
|
|||
Macro conversion from Lotus 1-2-3 to Excel (Sort Macro)
|
#8
Posted to microsoft.public.excel.programming
|
|||
|
|||
Macro conversion from Lotus 1-2-3 to Excel (Sort Macro)
Jim,
The code below sorts column "A" but if I wanted to add a level to the sort that would sort column "B". How would I do that? Range("data1").Sort Key1:=Range("A1"), Order1:=xlAscending, Header:=xlNo Thanks for your help. Carlos "Jim Thomlinson" wrote: Sorry Data1 should be in quotes... Sheets("A").Range("Data1"). ... -- HTH... Jim Thomlinson "Jim Thomlinson" wrote: You are exactly correct on both counts... -- HTH... Jim Thomlinson "cgsteel" wrote: Jim, Can the range be defined as a named range? Example: You put Sheets("A").Range("A1:Z100").......can it be Sheets("A").Range(data1) Data1 = would be the range name that defines "A1:Z100". If there is no Header, would the code be === Header:=xlNo ? Thanks Carlos "Jim Thomlinson" wrote: Something like this is probably close... sub Sort Stuff() Sheets("A").Range("A1:Z100").sort Key1:=range("N1"), Order1:=xlAscending, _ Header:=xlYes End sub -- HTH... Jim Thomlinson "cgsteel" wrote: I'm trying to create a Macro in Excel to do what my Lotus macro would do for me. My Lotus macro did the following: 1) Goto to sheet A cell A1 2) It defined the data range to sort --- I had predefined data ranges which were included in the Macro. 3) Selection of Primary key by moving over from cell A1 to the column that contains the Primary key to sort by........ I would move 14 columns over. 4) Selection of Descending or Ascending and then execute Can data ranges be defined within the Excel Macro? I don't care if the macro does exactly what I was doing in Lotus so I'm open to any suggestions. I appreciate your help in advance!!! Thanks Carlos |
#9
Posted to microsoft.public.excel.programming
|
|||
|
|||
Macro conversion from Lotus 1-2-3 to Excel (Sort Macro)
|
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Lotus macro i need to convert to Excel | Excel Discussion (Misc queries) | |||
Macro Help Needed - Excel 2007 - Print Macro with Auto Sort | Excel Worksheet Functions | |||
HOW DO I RUN A LOTUS MACRO IN EXCEL | Excel Discussion (Misc queries) | |||
Data table - Lotus 123 to Excel conversion | Excel Discussion (Misc queries) | |||
translate lotus 1-2-3 macro into excel macro using excel 2000 | Excel Programming |