Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I'm new to programming. i have a sheet that rows will keep being added in as
we get more jobs. i created a button to sort the data. i need code to tell the button to select all the data, even after more has been added. also, what would be the easiest code to tell a button to add a row for new entry... thank you |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
or if i can avoid selecting all together, i trust you guys for the better
method "steve" wrote: I'm new to programming. i have a sheet that rows will keep being added in as we get more jobs. i created a button to sort the data. i need code to tell the button to select all the data, even after more has been added. also, what would be the easiest code to tell a button to add a row for new entry... thank you |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Depending on what your data looks like, you might get away with just sorting the
whole column: With ActiveSheet.Columns("A:F") .Cells.Sort Key1:=.Columns(1), Order1:=xlAscending, _ Header:=xlYes, OrderCustom:=1, MatchCase:=False, _ Orientation:=xlTopToBottom End With Or if you can pick out a column that always has data in it when that row is used: Dim LastRow as long with activesheet lastrow = .cells(.rows.count,"A").end(xlup).row with .range("a1:F" & lastrow) .cells.sort ..... end with end with ===== And one more option. Use a dynamic range that expands or contracts when you insert/delete a row. Take a look at Debra Dalgleish's site to read more about it: http://www.contextures.com/xlNames01.html#Dynamic Then you can use that in your code: with worksheets("sheet1").range("yourrangenamehere") .cells.sort .... end with steve wrote: I'm new to programming. i have a sheet that rows will keep being added in as we get more jobs. i created a button to sort the data. i need code to tell the button to select all the data, even after more has been added. also, what would be the easiest code to tell a button to add a row for new entry... thank you -- Dave Peterson |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
selecting text area | Excel Worksheet Functions | |||
selecting certain text in long row of text | Excel Worksheet Functions | |||
Selecting text in cells & half of the Selected Text to be underLine | Excel Programming | |||
selecting contents of a text box in vba | Excel Programming | |||
Selecting ranges with a text box | Excel Programming |