Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Microsoft Office > Excel VBA > Excel VBA
Password Reminder
| FAQ | Members List | Search | Today's Posts | Mark Forums Read
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 tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old June 9th, 2005, 06:07 PM
Registered User
Join Date: Jun 2005
Location: , , USA.
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default Pointer to contents of another cell

I am trying to figure out how to have one cell point to the contents of another cell using VBA. For example, have cell A2 equal the contents of cell A1 such that if the user of the excel spreadsheet changes the contents of A1, cell A2 will automatically reflect that change.

If in excel I type into cell A2: "=A1", then when the contents of A1 changes, A2 automatically changes. That is what I want to accomplish, but with VBA.

Using VBA, if I set A2 = A1, cell A2 is set to the current value of A1, and A2 does not change if the user changes the value of A1.

Hope my description is clear. Any help would be appreciated.

Reply With Quote
  #2 (permalink)  
Old June 10th, 2005, 12:12 AM
Friend of Wrox
Join Date: Oct 2003
Location: , , Finland.
Posts: 168
Thanks: 0
Thanked 0 Times in 0 Posts

You can use worksheets Change event

Private Sub Worksheet_Change(ByVal Target As Range)
    Range("A2") = Range("A1")
End Sub


Reply With Quote
  #3 (permalink)  
Old June 14th, 2005, 03:51 PM
Registered User
Join Date: Jun 2005
Location: , , USA.
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts

I think that will do the trick, thanks very much for your help.
Reply With Quote

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
How to create a Hyperlink based on Cell Contents chatguy Excel VBA 4 October 15th, 2007 09:43 PM
I need to refer a cell within a cell like =RC[ RC2 chakravarthi_os Excel VBA 1 September 24th, 2006 08:19 AM
How to compare cell contents with a character? danwes Excel VBA 5 June 8th, 2005 11:36 AM
Lose cell Text when editing cell in VSFlexGrid 6 bobcratchet VB How-To 0 July 30th, 2004 09:32 AM
Delet contents of a single cell marmer Classic ASP Basics 1 August 27th, 2003 08:14 PM

All times are GMT -4. The time now is 05:28 PM.

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