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 11th, 2006, 11:45 AM
Fin Fin is offline
Registered User
 
Join Date: Jan 2006
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default VBA Address

Hi,

I'm trying to get VBA to remember a cell address so that I can return to it after entering data below that row. For example, if I have a table full of data and then add a number of rows of data directly below it, I want to know where the new data starts so that I can adjust accordingly before I sort the entire table and save it ready for the next addition of new data.

Thought it might have gone a little like this but I'm wrong.

Sub Macro4()

    Range("C10").Select
    Range("A65001").Value = Selection.Address()
    Dim Address As Variant
        Address = Range("A65001").Value
    Address.Select
End Sub

Please can someone help me.

Many thanks,

Fin.

 
Old January 11th, 2006, 11:49 AM
Friend of Wrox
 
Join Date: Jan 2005
Posts: 180
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi Fin,

Sub Macro4()
    Dim myAddress
    Range("C10").Select
    myAddress = Selection.Address
    Range(myAddress).Select
End Sub

should sort your problems,

cheers

Matt

 
Old January 11th, 2006, 12:43 PM
Fin Fin is offline
Registered User
 
Join Date: Jan 2006
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thanks Matt, works a treat.






Similar Threads
Thread Thread Starter Forum Replies Last Post
Code works in Excel VBA but not Access VBA fossx Access VBA 2 May 21st, 2007 08:00 AM
Getting the MAC Address mswombat Classic ASP Basics 0 June 3rd, 2006 11:45 AM
how to get the value at the address?? keepsmiling_sruti VB How-To 3 July 8th, 2005 01:15 PM
Excel VBA to SQL & back to VBA edesousa Excel VBA 1 June 1st, 2004 02:39 AM
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.