Solved

Worksheet link (not complete worksheet)

Posted on 2011-03-07
7
267 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
  • 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
Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

 
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 Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

A2 = A1 That kind of cell reference is relative.  If you copy it from A2 to B2, then B2 will get this: B2 = B1 That's all fine and good, but if you then insert a new row above row 2, you'll find: A3 = A1 B3 = B1 This is intentional. …
Introduction This Article briefly covers methods of calculating the NPV and IRR variants in Excel as well as the limitations in calculating and interpreting IRR results. Paraphrasing Richard Shockley, author of my favourite finance reference tex…
This Micro Tutorial demonstrates how to create Excel charts: column, area, line, bar, and scatter charts. Formatting tips are provided as well.
This Micro Tutorial will demonstrate in Google Sheets how to use the HYPERLINK function to create live links inside your spreadsheet.

708 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

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now