Solved

Worksheet link (not complete worksheet)

Posted on 2011-03-07
7
298 Views
Last Modified: 2012-08-14
how i do the link, but only with the cells that i want and not my entire worksheet? I use the code from Rorya in my past question and works perfect!


This is my past Question:
Hi, i want to know how to create a link between worksheets in the same workbook.

Example: i enter 25 in the sheet1 A1, this automatically appears in sheet2 A1 and if i enter 35 in sheet2 A1 then the value in sheet1 A1 change to 35, any idea?

This cannot be done with a formula
0
Comment
Question by:joyacv2
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 3
7 Comments
 
LVL 85

Expert Comment

by:Rory Archibald
ID: 35057418
What are the cells you want?
0
 
LVL 1

Author Comment

by:joyacv2
ID: 35057499
For example, A1 and D2
0
 
LVL 85

Accepted Solution

by:
Rory Archibald earned 500 total points
ID: 35057536
Then you want something like:
Private Sub Worksheet_Change(ByVal Target As Range)
Dim rngCell as range
if not intersect(target, range("A1,D2")) is nothing then
   On Error Resume Next
   Application.EnableEvents = False
   for each rngCell in intersect(target, range("A1,D2"))
   Sheets("Sheet2").Range(rngcell.Address).Value = rngcell.Value
   next rngcell
   Application.EnableEvents = True
end if
End Sub

Open in new window


0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 19

Expert Comment

by:akoster
ID: 35057554
to acieve the results as in the example, take these steps :

1) goto the cell A1 in sheet2
2) enter the following contents :

=sheet1!A1

3) press enter

done

If you want to do this for 10 by 10 cells, you can either

    perform this manually cell by cell on sheet2,

    or select the A1 cell on sheet2, hover the mouse cursor above the black dot on the lower right corner of the cell (mouse cursos should now be a 'plus' sign)
    drag the mouse cursor to a range holding all the cells where you want this functionality.
    Note that when you drag the mouse to the right, eg. to cell B1, this cell also links to cell B1 in sheet1 !
0
 
LVL 1

Author Comment

by:joyacv2
ID: 35057572
This will work for many cells, like a3, D5, c7, ect?
0
 
LVL 85

Expert Comment

by:Rory Archibald
ID: 35057581
Yes, as long as the total cell address is under 255 characters. If it's more than that then you would need to build up the range using Union (or rethink what you are doing! ;))
0
 
LVL 1

Author Closing Comment

by:joyacv2
ID: 35057593
Excelent!
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Improved? Move/Copy Add-in Replacement - How to avoid the annoying, “A formula or sheet you want to move or copy contains the name XXX, which already exists on the destination worksheet.” David Miller (dlmille)  It was one of those days… I wa…
Access developers frequently have requirements to interact with Excel (import from or output to) in their applications.  You might be able to accomplish this with the TransferSpreadsheet and OutputTo methods, but in this series of articles I will di…
This Micro Tutorial will demonstrate how to use longer labels with horizontal bar charts instead of the vertical column chart.
This Micro Tutorial will demonstrate in Google Sheets how to use the HYPERLINK function to create live links inside your spreadsheet.

756 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question