Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,814
Default Selecting text

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,814
Default Selecting text

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,758
Default Selecting text

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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
selecting text area dave7 Excel Worksheet Functions 1 January 24th 07 04:22 PM
selecting certain text in long row of text Jonathan Excel Worksheet Functions 1 August 27th 05 12:26 AM
Selecting text in cells & half of the Selected Text to be underLine Manish Singh Excel Programming 3 October 14th 04 07:34 PM
selecting contents of a text box in vba Neil[_18_] Excel Programming 1 April 10th 04 06:07 PM
Selecting ranges with a text box Bob Metzler Excel Programming 0 September 22nd 03 04:47 PM


All times are GMT +1. The time now is 02:54 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"