Home |
Search |
Today's Posts |
|
#2
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
should have been
ActiveSheet.Range("Print_Area").Sort Key1:=range("Print_Area").Cells(2, "p"), -- Don Guillett SalesAid Software "Don Guillett" wrote in message ... Sub sortprintareaonly()'another way with a one liner ActiveSheet.Range("Print_Area").Sort Key1:=range("print_area").Cells(2, "p"), Order1:=xlDescending End Sub -- Don Guillett SalesAid Software "Don Guillett" wrote in message news:... Are you trying to be funny or did you really goto college at Texas A&M? range("p2") is the same as cells(2,"P") or cells(2,16) Sub sortprintareaonly()'another way ActiveSheet.Range("Print_Area").Sort Key1:=.Cells(2, "p"), Order1:=xlDescending End Sub -- Don Guillett SalesAid Software "Inspector" wrote in message ... Is this what you're getting at? Sub sortprintareaonly() With ActiveSheet.Range("Print_Area") .Sort Key1:=Range(P2).Cells(2, 1), Order1:=xlDescending End With End Sub "Don Guillett" wrote: Perhaps a re-read of this may help you determine which column you desire. Since you didn't say what your "sort" column was, I was sorting by range(a2) cells(2,1) -- Don Guillett SalesAid Software "Inspector" wrote in message ... I'd love to but I'm lost, no clue. Sorry. "Don Guillett" wrote: Do so. -- Don Guillett SalesAid Software "Inspector" wrote in message ... My sort column is column P and I would like to activate it using 'control Q' or some other key along with the control key. "Don Guillett" wrote: Since you didn't say what your "sort" column was, I was sorting by range(a2) cells(2,1) -- Don Guillett SalesAid Software "Inspector" wrote in message ... It may do the trick.....but given the fact I know nothing about writing a macro....do I need to do anything else to this to fit my particular sheet or will this do it as it is? "Don Guillett" wrote: Does this help? Sub sortprintareaonly() With ActiveSheet.Range("Print_Area") .Sort Key1:=.Cells(2, 1), Order1:=xlAscending End With End Sub -- Don Guillett SalesAid Software "Inspector" wrote in message ... I would like to create a macro that will be triggered by 'control Q' to sort my data in decending order using my "sort" column. The amount of data will vary so I will need it to sort the print area only. Is this possible? I have no idea where to begin. Can someone help with this? Thanks, Inspector |
#3
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
This works well with one exception...after sorting descending then printing,
I need to sort back to the original data set up, ie: unsort or undo, NOT ascending. Sub sortprintareaonly() With ActiveSheet.Range("Print_Area") .Sort Key1:=.Cells(2, 16), Order1:=xlDescending activesheet.printout ..Sort Key1:=.Cells(2, 16), Order1:=xlascending End With End Sub "Don Guillett" wrote: should have been ActiveSheet.Range("Print_Area").Sort Key1:=range("Print_Area").Cells(2, "p"), -- Don Guillett SalesAid Software "Don Guillett" wrote in message ... Sub sortprintareaonly()'another way with a one liner ActiveSheet.Range("Print_Area").Sort Key1:=range("print_area").Cells(2, "p"), Order1:=xlDescending End Sub -- Don Guillett SalesAid Software "Don Guillett" wrote in message news:... Are you trying to be funny or did you really goto college at Texas A&M? range("p2") is the same as cells(2,"P") or cells(2,16) Sub sortprintareaonly()'another way ActiveSheet.Range("Print_Area").Sort Key1:=.Cells(2, "p"), Order1:=xlDescending End Sub -- Don Guillett SalesAid Software "Inspector" wrote in message ... Is this what you're getting at? Sub sortprintareaonly() With ActiveSheet.Range("Print_Area") .Sort Key1:=Range(P2).Cells(2, 1), Order1:=xlDescending End With End Sub "Don Guillett" wrote: Perhaps a re-read of this may help you determine which column you desire. Since you didn't say what your "sort" column was, I was sorting by range(a2) cells(2,1) -- Don Guillett SalesAid Software "Inspector" wrote in message ... I'd love to but I'm lost, no clue. Sorry. "Don Guillett" wrote: Do so. -- Don Guillett SalesAid Software "Inspector" wrote in message ... My sort column is column P and I would like to activate it using 'control Q' or some other key along with the control key. "Don Guillett" wrote: Since you didn't say what your "sort" column was, I was sorting by range(a2) cells(2,1) -- Don Guillett SalesAid Software "Inspector" wrote in message ... It may do the trick.....but given the fact I know nothing about writing a macro....do I need to do anything else to this to fit my particular sheet or will this do it as it is? "Don Guillett" wrote: Does this help? Sub sortprintareaonly() With ActiveSheet.Range("Print_Area") .Sort Key1:=.Cells(2, 1), Order1:=xlAscending End With End Sub -- Don Guillett SalesAid Software "Inspector" wrote in message ... I would like to create a macro that will be triggered by 'control Q' to sort my data in decending order using my "sort" column. The amount of data will vary so I will need it to sort the print area only. Is this possible? I have no idea where to begin. Can someone help with this? Thanks, Inspector |
#4
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
There are things you could do such as exiting the workbook without saving or
set up a helper column with 1,2,3,4, etc and sort on that after printing. This could be done with an addition to the macro. -- Don Guillett SalesAid Software "Inspector" wrote in message ... This works well with one exception...after sorting descending then printing, I need to sort back to the original data set up, ie: unsort or undo, NOT ascending. Sub sortprintareaonly() With ActiveSheet.Range("Print_Area") .Sort Key1:=.Cells(2, 16), Order1:=xlDescending activesheet.printout ..Sort Key1:=.Cells(2, 16), Order1:=xlascending End With End Sub "Don Guillett" wrote: should have been ActiveSheet.Range("Print_Area").Sort Key1:=range("Print_Area").Cells(2, "p"), -- Don Guillett SalesAid Software "Don Guillett" wrote in message ... Sub sortprintareaonly()'another way with a one liner ActiveSheet.Range("Print_Area").Sort Key1:=range("print_area").Cells(2, "p"), Order1:=xlDescending End Sub -- Don Guillett SalesAid Software "Don Guillett" wrote in message news:... Are you trying to be funny or did you really goto college at Texas A&M? range("p2") is the same as cells(2,"P") or cells(2,16) Sub sortprintareaonly()'another way ActiveSheet.Range("Print_Area").Sort Key1:=.Cells(2, "p"), Order1:=xlDescending End Sub -- Don Guillett SalesAid Software "Inspector" wrote in message ... Is this what you're getting at? Sub sortprintareaonly() With ActiveSheet.Range("Print_Area") .Sort Key1:=Range(P2).Cells(2, 1), Order1:=xlDescending End With End Sub "Don Guillett" wrote: Perhaps a re-read of this may help you determine which column you desire. Since you didn't say what your "sort" column was, I was sorting by range(a2) cells(2,1) -- Don Guillett SalesAid Software "Inspector" wrote in message ... I'd love to but I'm lost, no clue. Sorry. "Don Guillett" wrote: Do so. -- Don Guillett SalesAid Software "Inspector" wrote in message ... My sort column is column P and I would like to activate it using 'control Q' or some other key along with the control key. "Don Guillett" wrote: Since you didn't say what your "sort" column was, I was sorting by range(a2) cells(2,1) -- Don Guillett SalesAid Software "Inspector" wrote in message ... It may do the trick.....but given the fact I know nothing about writing a macro....do I need to do anything else to this to fit my particular sheet or will this do it as it is? "Don Guillett" wrote: Does this help? Sub sortprintareaonly() With ActiveSheet.Range("Print_Area") .Sort Key1:=.Cells(2, 1), Order1:=xlAscending End With End Sub -- Don Guillett SalesAid Software "Inspector" wrote in message ... I would like to create a macro that will be triggered by 'control Q' to sort my data in decending order using my "sort" column. The amount of data will vary so I will need it to sort the print area only. Is this possible? I have no idea where to begin. Can someone help with this? Thanks, Inspector |
#5
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
Not sure I follow you. Let me explain what I do now:
After entering my data I click 'Save' I then highlight the area I want to sort not including Row 1 which has column headings. I then click Data, Sort (column P) descending, I then print, then click "Undo" to return to my original setup before I sorted in descending order. My sheet has blank rows so column P is a helper column I guess containing numbers in each cell so that it will sort with the blank rows in the proper places. The macro works great for sorting desending then printing but it then sorts ascending which I dont' want to do. I suppose I could add another column with numbers in ascending order and after the print I could sort on that coumn in ascending order. Would that work? "Don Guillett" wrote: There are things you could do such as exiting the workbook without saving or set up a helper column with 1,2,3,4, etc and sort on that after printing. This could be done with an addition to the macro. -- Don Guillett SalesAid Software "Inspector" wrote in message ... This works well with one exception...after sorting descending then printing, I need to sort back to the original data set up, ie: unsort or undo, NOT ascending. Sub sortprintareaonly() With ActiveSheet.Range("Print_Area") .Sort Key1:=.Cells(2, 16), Order1:=xlDescending activesheet.printout ..Sort Key1:=.Cells(2, 16), Order1:=xlascending End With End Sub "Don Guillett" wrote: should have been ActiveSheet.Range("Print_Area").Sort Key1:=range("Print_Area").Cells(2, "p"), -- Don Guillett SalesAid Software "Don Guillett" wrote in message ... Sub sortprintareaonly()'another way with a one liner ActiveSheet.Range("Print_Area").Sort Key1:=range("print_area").Cells(2, "p"), Order1:=xlDescending End Sub -- Don Guillett SalesAid Software "Don Guillett" wrote in message news:... Are you trying to be funny or did you really goto college at Texas A&M? range("p2") is the same as cells(2,"P") or cells(2,16) Sub sortprintareaonly()'another way ActiveSheet.Range("Print_Area").Sort Key1:=.Cells(2, "p"), Order1:=xlDescending End Sub -- Don Guillett SalesAid Software "Inspector" wrote in message ... Is this what you're getting at? Sub sortprintareaonly() With ActiveSheet.Range("Print_Area") .Sort Key1:=Range(P2).Cells(2, 1), Order1:=xlDescending End With End Sub "Don Guillett" wrote: Perhaps a re-read of this may help you determine which column you desire. Since you didn't say what your "sort" column was, I was sorting by range(a2) cells(2,1) -- Don Guillett SalesAid Software "Inspector" wrote in message ... I'd love to but I'm lost, no clue. Sorry. "Don Guillett" wrote: Do so. -- Don Guillett SalesAid Software "Inspector" wrote in message ... My sort column is column P and I would like to activate it using 'control Q' or some other key along with the control key. "Don Guillett" wrote: Since you didn't say what your "sort" column was, I was sorting by range(a2) cells(2,1) -- Don Guillett SalesAid Software "Inspector" wrote in message ... It may do the trick.....but given the fact I know nothing about writing a macro....do I need to do anything else to this to fit my particular sheet or will this do it as it is? "Don Guillett" wrote: Does this help? Sub sortprintareaonly() With ActiveSheet.Range("Print_Area") .Sort Key1:=.Cells(2, 1), Order1:=xlAscending End With End Sub -- Don Guillett SalesAid Software "Inspector" wrote in message ... I would like to create a macro that will be triggered by 'control Q' to sort my data in decending order using my "sort" column. The amount of data will vary so I will need it to sort the print area only. Is this possible? I have no idea where to begin. Can someone help with this? Thanks, Inspector |
#6
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
Isn't that what I said. BTW, I do custom work.
-- Don Guillett SalesAid Software "Inspector" wrote in message ... Not sure I follow you. Let me explain what I do now: After entering my data I click 'Save' I then highlight the area I want to sort not including Row 1 which has column headings. I then click Data, Sort (column P) descending, I then print, then click "Undo" to return to my original setup before I sorted in descending order. My sheet has blank rows so column P is a helper column I guess containing numbers in each cell so that it will sort with the blank rows in the proper places. The macro works great for sorting desending then printing but it then sorts ascending which I dont' want to do. I suppose I could add another column with numbers in ascending order and after the print I could sort on that coumn in ascending order. Would that work? "Don Guillett" wrote: There are things you could do such as exiting the workbook without saving or set up a helper column with 1,2,3,4, etc and sort on that after printing. This could be done with an addition to the macro. -- Don Guillett SalesAid Software "Inspector" wrote in message ... This works well with one exception...after sorting descending then printing, I need to sort back to the original data set up, ie: unsort or undo, NOT ascending. Sub sortprintareaonly() With ActiveSheet.Range("Print_Area") .Sort Key1:=.Cells(2, 16), Order1:=xlDescending activesheet.printout ..Sort Key1:=.Cells(2, 16), Order1:=xlascending End With End Sub "Don Guillett" wrote: should have been ActiveSheet.Range("Print_Area").Sort Key1:=range("Print_Area").Cells(2, "p"), -- Don Guillett SalesAid Software "Don Guillett" wrote in message ... Sub sortprintareaonly()'another way with a one liner ActiveSheet.Range("Print_Area").Sort Key1:=range("print_area").Cells(2, "p"), Order1:=xlDescending End Sub -- Don Guillett SalesAid Software "Don Guillett" wrote in message news:... Are you trying to be funny or did you really goto college at Texas A&M? range("p2") is the same as cells(2,"P") or cells(2,16) Sub sortprintareaonly()'another way ActiveSheet.Range("Print_Area").Sort Key1:=.Cells(2, "p"), Order1:=xlDescending End Sub -- Don Guillett SalesAid Software "Inspector" wrote in message ... Is this what you're getting at? Sub sortprintareaonly() With ActiveSheet.Range("Print_Area") .Sort Key1:=Range(P2).Cells(2, 1), Order1:=xlDescending End With End Sub "Don Guillett" wrote: Perhaps a re-read of this may help you determine which column you desire. Since you didn't say what your "sort" column was, I was sorting by range(a2) cells(2,1) -- Don Guillett SalesAid Software "Inspector" wrote in message ... I'd love to but I'm lost, no clue. Sorry. "Don Guillett" wrote: Do so. -- Don Guillett SalesAid Software "Inspector" wrote in message ... My sort column is column P and I would like to activate it using 'control Q' or some other key along with the control key. "Don Guillett" wrote: Since you didn't say what your "sort" column was, I was sorting by range(a2) cells(2,1) -- Don Guillett SalesAid Software "Inspector" wrote in message ... It may do the trick.....but given the fact I know nothing about writing a macro....do I need to do anything else to this to fit my particular sheet or will this do it as it is? "Don Guillett" wrote: Does this help? Sub sortprintareaonly() With ActiveSheet.Range("Print_Area") .Sort Key1:=.Cells(2, 1), Order1:=xlAscending End With End Sub -- Don Guillett SalesAid Software "Inspector" wrote in message ... I would like to create a macro that will be triggered by 'control Q' to sort my data in decending order using my "sort" column. The amount of data will vary so I will need it to sort the print area only. Is this possible? I have no idea where to begin. Can someone help with this? Thanks, Inspector |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
error when running cut & paste macro | Excel Worksheet Functions | |||
Compiling macro based on cell values | Excel Discussion (Misc queries) | |||
Search, Copy, Paste Macro in Excel | Excel Worksheet Functions | |||
Closing File Error | Excel Discussion (Misc queries) | |||
Highlight Range - wrong macro, please edit. | Excel Worksheet Functions |