Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default How can i get activecell address

Hi, everybody

I can get the activecell address. using below code.
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Range("a1").Value = ActiveCell.Address
End Sub

But, if I select multi cells (ex : range("b1:f:20")
I can't get activecell.address.
Please let' me know how to get the activecell address in this case.








Bond! <Chon, Sung-Chul
  #2   Report Post  
Posted to microsoft.public.excel.programming
KL KL is offline
external usenet poster
 
Posts: 201
Default How can i get activecell address

Hi,

Try this:

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Range("a1").Value = Target.Address
End Sub

Regards,
KL


"Bond S.C" <daumbond at wrote in message
...
Hi, everybody

I can get the activecell address. using below code.
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Range("a1").Value = ActiveCell.Address
End Sub

But, if I select multi cells (ex : range("b1:f:20")
I can't get activecell.address.
Please let' me know how to get the activecell address in this case.








Bond! <Chon, Sung-Chul



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default How can i get activecell address

Thank you. KL

According to your Code
I get B1:F20 at cell A1

It is not easy to explain about my problem.

Pleas confirm this process
1. Multi select cells(Drag from B1:C10)
2. Cell B1 is reversed
3. When press "Enter Key" the cell only move in the selected area
For example
B1 - C1 (at that case I want the cell A1's value is = $C$1
And enter again the reversed cell is from C1 to B2
(at thac case I want the cell A1's value is $B$2


Is there any soluctions ?


Try this:



Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Range("a1").Value = Target.Address
End Sub

Regards,
KL


"Bond S.C" <daumbond at wrote in message
...
Hi, everybody

I can get the activecell address. using below code.
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Range("a1").Value = ActiveCell.Address
End Sub

But, if I select multi cells (ex : range("b1:f:20")
I can't get activecell.address.
Please let' me know how to get the activecell address in this case.








Bond! <Chon, Sung-Chul




  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,120
Default How can i get activecell address

That is the selection address. If he really means activecell address, he
needs

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Range("a1").Value = Target(1, 1).Address
End Sub


--
HTH

Bob Phillips

"KL" wrote in message
...
Hi,

Try this:

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Range("a1").Value = Target.Address
End Sub

Regards,
KL


"Bond S.C" <daumbond at wrote in message
...
Hi, everybody

I can get the activecell address. using below code.
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Range("a1").Value = ActiveCell.Address
End Sub

But, if I select multi cells (ex : range("b1:f:20")
I can't get activecell.address.
Please let' me know how to get the activecell address in this case.








Bond! <Chon, Sung-Chul





  #5   Report Post  
Posted to microsoft.public.excel.programming
KL KL is offline
external usenet poster
 
Posts: 201
Default How can i get activecell address

Hi Bob,

What if the selection is done from bottom up and/or right to left ? :-)
Actually the original code should work with multiple selection :-))) LOL

Regards,
KL


"Bob Phillips" wrote in message
...
That is the selection address. If he really means activecell address, he
needs

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Range("a1").Value = Target(1, 1).Address
End Sub


--
HTH

Bob Phillips

"KL" wrote in message
...
Hi,

Try this:

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Range("a1").Value = Target.Address
End Sub

Regards,
KL


"Bond S.C" <daumbond at wrote in message
...
Hi, everybody

I can get the activecell address. using below code.
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Range("a1").Value = ActiveCell.Address
End Sub

But, if I select multi cells (ex : range("b1:f:20")
I can't get activecell.address.
Please let' me know how to get the activecell address in this case.








Bond! <Chon, Sung-Chul









  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 747
Default How can i get activecell address

As you have pointed out, when you select a multi-cell range and then
repeatedly press the Enter key, the active cell changes within the selected
range instead of within the entire worksheet. However, since the selection
itself does not change, the SelectionChange event is not fired. And
therefore, you can't return the new active cell address using the
SelectionChange event.

There is no worksheet level event that covers changing the active cell as
opposed to the selection. However, you can always obtain the active cell
address by other means: Change event, BeforeRightClick event, clicking a
button or remapping a key or key combination using OnKey etc.

Do you need to return the active cell address in A1 each time the Enter key
is clicked and at the same time keep the active cell within the selected
range? If so, this will be difficult.

Regards,
Greg


Sub RemapEnterKey

"Bond S.C" wrote:

Thank you. KL

According to your Code
I get B1:F20 at cell A1

It is not easy to explain about my problem.

Pleas confirm this process
1. Multi select cells(Drag from B1:C10)
2. Cell B1 is reversed
3. When press "Enter Key" the cell only move in the selected area
For example
B1 - C1 (at that case I want the cell A1's value is = $C$1
And enter again the reversed cell is from C1 to B2
(at thac case I want the cell A1's value is $B$2


Is there any soluctions ?


Try this:



Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Range("a1").Value = Target.Address
End Sub

Regards,
KL


"Bond S.C" <daumbond at wrote in message
...
Hi, everybody

I can get the activecell address. using below code.
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Range("a1").Value = ActiveCell.Address
End Sub

But, if I select multi cells (ex : range("b1:f:20")
I can't get activecell.address.
Please let' me know how to get the activecell address in this case.








Bond! <Chon, Sung-Chul




  #8   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,120
Default How can i get activecell address

Morning KL,

You are right, it should be Activecell.Address.

Bob

"KL" wrote in message
...
Hi Bob,

What if the selection is done from bottom up and/or right to left ? :-)
Actually the original code should work with multiple selection :-))) LOL

Regards,
KL


"Bob Phillips" wrote in message
...
That is the selection address. If he really means activecell address, he
needs

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Range("a1").Value = Target(1, 1).Address
End Sub


--
HTH

Bob Phillips

"KL" wrote in message
...
Hi,

Try this:

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Range("a1").Value = Target.Address
End Sub

Regards,
KL


"Bond S.C" <daumbond at wrote in message
...
Hi, everybody

I can get the activecell address. using below code.
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Range("a1").Value = ActiveCell.Address
End Sub

But, if I select multi cells (ex : range("b1:f:20")
I can't get activecell.address.
Please let' me know how to get the activecell address in this case.








Bond! <Chon, Sung-Chul








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
activecell.address problem Jason Excel Programming 2 March 10th 05 10:12 PM
identify the name of the activecell not its address RogerTheDodgerTheDirtyOldSod Excel Programming 2 September 26th 04 09:53 PM
Using Activecell.Address when defining name Hardy[_8_] Excel Programming 4 September 14th 04 09:06 AM
Activecell address Patty2005[_4_] Excel Programming 2 August 7th 04 03:58 AM
ActiveCell.Address Todd Huttenstine Excel Programming 3 July 27th 04 04:45 PM


All times are GMT +1. The time now is 04:32 AM.

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"