changing a SendKeys "(^+{home})" to a function

G

Guest

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.
 
G

Guest

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+Activecell.Row-1
Range("A1",Cells(ROWCOUNT,1).Address).Entirerow.Select
 
G

Guest

it works just fine thank you very much.

other question:
there is some way to create a texbox but when you write in it the characters
appears as (**********) (like the textboxes used in paswords textboxes)
 
D

Dave Peterson

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.)
 
G

Guest

Be careful with used range. It is similar to xlLastCell in that it is set
when the spreadsheet is saved, so it may not be the cell you think it is when
you run the code...

HTH
 
G

Guest

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

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top