Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Andrzej
 
Posts: n/a
Default how read value from last selected cell? It is possible? how get adress last selected cell?

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   Report Post  
Nick Hodge
 
Posts: n/a
Default

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
HIS


"Andrzej" wrote in message
...
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   Report Post  
Andrzej
 
Posts: n/a
Default

OK
it's works correctly. Thanks

but one mo
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" napisał w
wiadomości ...
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
HIS


"Andrzej" wrote in message
...
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   Report Post  
Nick Hodge
 
Posts: n/a
Default

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
HIS


"Andrzej" wrote in message
...
OK
it's works correctly. Thanks

but one mo
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" napisał
w
wiadomości ...
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
HIS


"Andrzej" wrote in message
...
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   Report Post  
Andrzej
 
Posts: n/a
Default

hi Nick
I thought about this.. Thank for help

Andrzej



Użytkownik "Nick Hodge" napisał w
wiadomości ...
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
HIS


"Andrzej" wrote in message
...
OK
it's works correctly. Thanks

but one mo
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"

napisał
w
wiadomości ...
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
HIS


"Andrzej" wrote in message
...
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
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
up to 7 functions? ALex Excel Worksheet Functions 10 April 12th 05 06:42 PM
Can macros output to a cell selected prior to running it? winnie Excel Worksheet Functions 3 February 18th 05 12:03 AM
Using Jet to read excel file returns blank for last cell - sometim Ron Excel Discussion (Misc queries) 1 December 9th 04 09:21 AM
Addition to Turn cell red if today is greater or equal to date in cell Rich New Users to Excel 2 December 9th 04 03:06 AM
VLookup resulting in a blank cell... KempensBoerke Excel Worksheet Functions 1 October 28th 04 09:57 PM


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

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

About Us

"It's about Microsoft Excel"