+ Reply to Thread
Results 1 to 8 of 8

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

  1. #1
    filo666
    Guest

    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. #2
    frankt
    Guest

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

    "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. #3
    filo666
    Guest

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

    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)





    "Jim Thomlinson" wrote:

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


  4. #4
    Dave Peterson
    Guest

    Re: 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

  5. #5
    Jim Thomlinson
    Guest

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

    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

    "filo666" wrote:

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


  6. #6
    Jim Thomlinson
    Guest

    RE: 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.


  7. #7
    filo666
    Guest

    Re: 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
    >


  8. #8
    Jim Thomlinson
    Guest

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

    Private Sub UserForm_Initialize()
    TextBox1.PasswordChar = "*"
    End Sub

    HTH

    "filo666" wrote:

    > 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)
    >
    >
    >
    >
    >
    > "Jim Thomlinson" wrote:
    >
    > > 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 to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1