Solved

Worksheet link (not complete worksheet)

Posted on 2011-03-07
7
301 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
Technology Partners: 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:Arno Koster
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

Technology Partners: 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!

Question has a verified solution.

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

Workbook link problems after copying tabs to a new workbook? David Miller (dlmille) Intro Have you either copied sheets to a new workbook, and after having saved and opened that workbook, you find that there are links back to the original sou…
In Part II of this series, I will discuss how to identify all open instances of Excel and enumerate the workbooks, spreadsheets, and named ranges within each of those instances.
Many functions in Excel can make decisions. The most simple of these is the IF function: it returns a value depending on whether a condition you describe is true or false. Once you get the hang of using the IF function, you will find it easier to us…
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

737 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