Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 265
Default changing a SendKeys "(^+{home})" to a function

look the folowing code atached:

Cells(1, 1).Select
ActiveSheet.Cells(Rows.Count, ActiveCell.Column).End(xlUp).Select
ActiveCell.EntireRow.Select
SendKeys "(^+{home})"

I want to change the sendkey line to a function (the send key press
control+shift+home so it selects tall the rows from the bottom to the
beginning of the sheet)

TIA.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default changing a SendKeys "(^+{home})" to a function

Forget SENDKEYS and the other code. For the described action these three
lines will do it. There are additional methods but this is very direct. In
your case the first line may actully be enough by itself since it would
select all used cells regardless when they reside. If row 1 was empty and not
selected it would not affect the net result in most cases. Just depends on
what you really want to accomplish.

Activesheet.Usedrange.Select
ROWCOUNT=activesheet.Usedrange.Rows.Count+Activece ll.Row-1
Range("A1",Cells(ROWCOUNT,1).Address).Entirerow.Se lect

"filo666" wrote:

look the folowing code atached:

Cells(1, 1).Select
ActiveSheet.Cells(Rows.Count, ActiveCell.Column).End(xlUp).Select
ActiveCell.EntireRow.Select
SendKeys "(^+{home})"

I want to change the sendkey line to a function (the send key press
control+shift+home so it selects tall the rows from the bottom to the
beginning of the sheet)

TIA.

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,758
Default changing a SendKeys "(^+{home})" to a function

How about:

activesheet.usedrange.rows.select

or

with activesheet
.range("a1",.usedrange).rows.select
end with

or

With ActiveSheet
.Range("a1", .Cells(.Rows.Count, ActiveCell.Column).End(xlUp)) _
.EntireRow.Select
End With

(I think it's the last one, but I'm kind of confused.)

filo666 wrote:

look the folowing code atached:

Cells(1, 1).Select
ActiveSheet.Cells(Rows.Count, ActiveCell.Column).End(xlUp).Select
ActiveCell.EntireRow.Select
SendKeys "(^+{home})"

I want to change the sendkey line to a function (the send key press
control+shift+home so it selects tall the rows from the bottom to the
beginning of the sheet)

TIA.


--

Dave Peterson
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 265
Default changing a SendKeys "(^+{home})" to a function

Jim, Frank and Dave: tanks you very much, all the information you gave me was
very helpfully

"Dave Peterson" wrote:

How about:

activesheet.usedrange.rows.select

or

with activesheet
.range("a1",.usedrange).rows.select
end with

or

With ActiveSheet
.Range("a1", .Cells(.Rows.Count, ActiveCell.Column).End(xlUp)) _
.EntireRow.Select
End With

(I think it's the last one, but I'm kind of confused.)

filo666 wrote:

look the folowing code atached:

Cells(1, 1).Select
ActiveSheet.Cells(Rows.Count, ActiveCell.Column).End(xlUp).Select
ActiveCell.EntireRow.Select
SendKeys "(^+{home})"

I want to change the sendkey line to a function (the send key press
control+shift+home so it selects tall the rows from the bottom to the
beginning of the sheet)

TIA.


--

Dave Peterson

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 983
Default changing a SendKeys "(^+{home})" to a function

Try this

ActiveSheet.Range("A1", Range("A65535").End(xlUp)).EntireRow.Select

HTH

"filo666" wrote:

look the folowing code atached:

Cells(1, 1).Select
ActiveSheet.Cells(Rows.Count, ActiveCell.Column).End(xlUp).Select
ActiveCell.EntireRow.Select
SendKeys "(^+{home})"

I want to change the sendkey line to a function (the send key press
control+shift+home so it selects tall the rows from the bottom to the
beginning of the sheet)

TIA.



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
How do I stop "global" hyperlinks changing to "local" links? Em Excel Worksheet Functions 2 August 26th 08 01:18 PM
Excel: Changing "numeric $" to "text $" in a different cell. Heather_CCF Excel Worksheet Functions 1 September 5th 06 06:06 PM
Changing "returned" values from "0" to "blank" LATATC Excel Worksheet Functions 2 October 20th 05 04:41 PM
sendkeys "^v" behavior changed with the office 2003 version? Tarzan of the VisualBasic Gorillas Excel Programming 0 September 3rd 04 05:02 PM
SENDKEYS change the "Number Lock" status Kenneth Lam Excel Programming 1 May 23rd 04 12:37 PM


All times are GMT +1. The time now is 10:21 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"