+ Reply to Thread
Results 1 to 5 of 5

how read value from last selected cell? It is possible? how get adress last

  1. #1
    Andrzej
    Guest

    how read value from last selected cell? It is possible? how get adress last

    for example.

    I write to cell A11 value "hello",
    and next:
    IF I click "ENTER" or IF I click mouse in any different cell (A15, B10,
    C1... free choice) I wont to display:
    MsgBox "Value in your last selected cell = ???"

    On this example MsgBox "Value in your last selected cell = hello"

    it is very important for me.
    I try with event of Private Sub Worksheet_Change(ByVal Target As Range) ??
    but

    thanks everybody,
    Andrzej



  2. #2
    Nick Hodge
    Guest

    Re: how read value from last selected cell? It is possible? how get adress last selected cell?

    Andrzej

    You have little choice but to use the Worksheet_Change() event as the
    Worksheet_SelectionChange() event, give you the cell being selected rather
    than the one that you have left. You may also do better with a Public
    variable, but the Worksheet_Change event would look like this

    Private Sub Worksheet_Change(ByVal Target As Range)
    MsgBox "Value in the cell just changed is " & Target.Value
    End Sub

    --
    HTH
    Nick Hodge
    Microsoft MVP - Excel
    Southampton, England
    [email protected]HIS


    "Andrzej" <[email protected]> wrote in message
    news:[email protected]...
    > for example.
    >
    > I write to cell A11 value "hello",
    > and next:
    > IF I click "ENTER" or IF I click mouse in any different cell (A15, B10,
    > C1... free choice) I wont to display:
    > MsgBox "Value in your last selected cell = ???"
    >
    > On this example MsgBox "Value in your last selected cell = hello"
    >
    > it is very important for me.
    > I try with event of Private Sub Worksheet_Change(ByVal Target As Range) ??
    > but
    >
    > thanks everybody,
    > Andrzej
    >
    >




  3. #3
    Andrzej
    Guest

    Re: how read value from last selected cell? It is possible? how get adress last selected cell?

    OK
    it's works correctly. Thanks

    but one more:
    I would like that it will be works, provided that last selected cell belongs
    to first column (only A)
    for example last selected cell : A1, A20, A100, A40000 , etc)
    Is it possible ??




    Użytkownik "Nick Hodge" <[email protected]> napisał w
    wiadomości news:#[email protected]...
    > Andrzej
    >
    > You have little choice but to use the Worksheet_Change() event as the
    > Worksheet_SelectionChange() event, give you the cell being selected rather
    > than the one that you have left. You may also do better with a Public
    > variable, but the Worksheet_Change event would look like this
    >
    > Private Sub Worksheet_Change(ByVal Target As Range)
    > MsgBox "Value in the cell just changed is " & Target.Value
    > End Sub
    >
    > --
    > HTH
    > Nick Hodge
    > Microsoft MVP - Excel
    > Southampton, England
    > [email protected]HIS
    >
    >
    > "Andrzej" <[email protected]> wrote in message
    > news:[email protected]...
    > > for example.
    > >
    > > I write to cell A11 value "hello",
    > > and next:
    > > IF I click "ENTER" or IF I click mouse in any different cell (A15, B10,
    > > C1... free choice) I wont to display:
    > > MsgBox "Value in your last selected cell = ???"
    > >
    > > On this example MsgBox "Value in your last selected cell = hello"
    > >
    > > it is very important for me.
    > > I try with event of Private Sub Worksheet_Change(ByVal Target As Range)

    ??
    > > but
    > >
    > > thanks everybody,
    > > Andrzej
    > >
    > >

    >
    >




  4. #4
    Nick Hodge
    Guest

    Re: how read value from last selected cell? It is possible? how get adress last selected cell?

    Andrzej

    Sure

    Private Sub Worksheet_Change(ByVal Target As Range)
    If Not Application.Intersect(Columns("A:A"), Target) Is Nothing Then
    MsgBox "Value in the cell just changed in column A is " & Target.Value
    End If
    End Sub


    --
    HTH
    Nick Hodge
    Microsoft MVP - Excel
    Southampton, England
    [email protected]HIS


    "Andrzej" <[email protected]> wrote in message
    news:[email protected]...
    > OK
    > it's works correctly. Thanks
    >
    > but one more:
    > I would like that it will be works, provided that last selected cell
    > belongs
    > to first column (only A)
    > for example last selected cell : A1, A20, A100, A40000 , etc)
    > Is it possible ??
    >
    >
    >
    >
    > Użytkownik "Nick Hodge" <[email protected]> napisał
    > w
    > wiadomości news:#[email protected]...
    >> Andrzej
    >>
    >> You have little choice but to use the Worksheet_Change() event as the
    >> Worksheet_SelectionChange() event, give you the cell being selected
    >> rather
    >> than the one that you have left. You may also do better with a Public
    >> variable, but the Worksheet_Change event would look like this
    >>
    >> Private Sub Worksheet_Change(ByVal Target As Range)
    >> MsgBox "Value in the cell just changed is " & Target.Value
    >> End Sub
    >>
    >> --
    >> HTH
    >> Nick Hodge
    >> Microsoft MVP - Excel
    >> Southampton, England
    >> [email protected]HIS
    >>
    >>
    >> "Andrzej" <[email protected]> wrote in message
    >> news:[email protected]...
    >> > for example.
    >> >
    >> > I write to cell A11 value "hello",
    >> > and next:
    >> > IF I click "ENTER" or IF I click mouse in any different cell (A15,
    >> > B10,
    >> > C1... free choice) I wont to display:
    >> > MsgBox "Value in your last selected cell = ???"
    >> >
    >> > On this example MsgBox "Value in your last selected cell = hello"
    >> >
    >> > it is very important for me.
    >> > I try with event of Private Sub Worksheet_Change(ByVal Target As Range)

    > ??
    >> > but
    >> >
    >> > thanks everybody,
    >> > Andrzej
    >> >
    >> >

    >>
    >>

    >
    >




  5. #5
    Andrzej
    Guest

    Re: how read value from last selected cell? It is possible? how get adress last selected cell?

    hi Nick
    I thought about this.. Thank for help

    Andrzej



    Użytkownik "Nick Hodge" <[email protected]> napisał w
    wiadomości news:[email protected]...
    > Andrzej
    >
    > Sure
    >
    > Private Sub Worksheet_Change(ByVal Target As Range)
    > If Not Application.Intersect(Columns("A:A"), Target) Is Nothing Then
    > MsgBox "Value in the cell just changed in column A is " & Target.Value
    > End If
    > End Sub
    >
    >
    > --
    > HTH
    > Nick Hodge
    > Microsoft MVP - Excel
    > Southampton, England
    > [email protected]HIS
    >
    >
    > "Andrzej" <[email protected]> wrote in message
    > news:[email protected]...
    > > OK
    > > it's works correctly. Thanks
    > >
    > > but one more:
    > > I would like that it will be works, provided that last selected cell
    > > belongs
    > > to first column (only A)
    > > for example last selected cell : A1, A20, A100, A40000 , etc)
    > > Is it possible ??
    > >
    > >
    > >
    > >
    > > Użytkownik "Nick Hodge" <[email protected]>

    napisał
    > > w
    > > wiadomości news:#[email protected]...
    > >> Andrzej
    > >>
    > >> You have little choice but to use the Worksheet_Change() event as the
    > >> Worksheet_SelectionChange() event, give you the cell being selected
    > >> rather
    > >> than the one that you have left. You may also do better with a Public
    > >> variable, but the Worksheet_Change event would look like this
    > >>
    > >> Private Sub Worksheet_Change(ByVal Target As Range)
    > >> MsgBox "Value in the cell just changed is " & Target.Value
    > >> End Sub
    > >>
    > >> --
    > >> HTH
    > >> Nick Hodge
    > >> Microsoft MVP - Excel
    > >> Southampton, England
    > >> [email protected]HIS
    > >>
    > >>
    > >> "Andrzej" <[email protected]> wrote in message
    > >> news:[email protected]...
    > >> > for example.
    > >> >
    > >> > I write to cell A11 value "hello",
    > >> > and next:
    > >> > IF I click "ENTER" or IF I click mouse in any different cell (A15,
    > >> > B10,
    > >> > C1... free choice) I wont to display:
    > >> > MsgBox "Value in your last selected cell = ???"
    > >> >
    > >> > On this example MsgBox "Value in your last selected cell = hello"
    > >> >
    > >> > it is very important for me.
    > >> > I try with event of Private Sub Worksheet_Change(ByVal Target As

    Range)
    > > ??
    > >> > but
    > >> >
    > >> > thanks everybody,
    > >> > Andrzej
    > >> >
    > >> >
    > >>
    > >>

    > >
    > >

    >
    >




+ 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