Wrox Programmer Forums
|
Excel VBA Discuss using VBA for Excel programming.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Excel VBA section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old January 4th, 2006, 01:13 PM
Friend of Wrox
 
Join Date: Oct 2003
Posts: 168
Thanks: 0
Thanked 0 Times in 0 Posts
Default Activecell Address

Hi,

I need to know address when I change the value.
There's Change event in worksheet, but it tells the activecell address after I hit enter and the address is not the same as just changed.

-vemaju
__________________
-vemaju
 
Old January 4th, 2006, 01:28 PM
Registered User
 
Join Date: Jan 2006
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Option Explicit


Dim rngLast As Range


Private Sub Worksheet_SelectionChange(ByVal Target As Range)
    On Error GoTo firstRun
    MsgBox "Current Address: " & Target.Address(0, 0) & vbCrLf & _
        "Last Address: " & rngLast.Address(0, 0)
firstRun:
    'must be last
    Set rngLast = Target
End Sub

This was written by someone in microsoft.public.excel.programming

a super site, you can subscribe through Google

 
Old January 4th, 2006, 01:36 PM
Registered User
 
Join Date: Jan 2006
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default

This one was written by my "god father" or more "god son" Tom Ogilvy, I really have no idea about his age

Here it is

Option Explicit


Dim rngLast As Range


Private Sub Worksheet_SelectionChange(ByVal Target As Range)
 If Not rngLast Is Nothing Then
    MsgBox "Current Address: " & Target.Address(0, 0) & vbCrLf & _
        "Last Address: " & rngLast.Address(0, 0)
 End If
    Set rngLast = Target
End Sub






Similar Threads
Thread Thread Starter Forum Replies Last Post
Analyze if ActiveCell is part of specified Range babers09 Excel VBA 1 June 14th, 2007 09:12 PM
how to get the value at the address?? keepsmiling_sruti VB How-To 3 July 8th, 2005 01:15 PM
HYPERLINK in activecell icayan Excel VBA 4 May 24th, 2005 12:22 PM
changing ActiveCell sedolphi Excel VBA 1 May 17th, 2004 02:37 PM
Retreiving IP address & gateway address sjangit VBScript 0 February 3rd, 2004 02:02 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.