Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 22
Default link cells in multiple worksheets same workbook with excel vba

Hi all,
I'm trying to link some cells that are in different worksheets (i have
alot of sheets) in the same workbook to a Master worksheet in the same
workbook. I'd like to use vba to do this. The cells to link to are the
same in all worksheets. So for example, in Master worksheet, I need C2
to link to sheet1.C3 and C3 to link to sheet2.C3
Can anyone point me in the right direction on how to do this?
Thanks!
Moon

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default link cells in multiple worksheets same workbook with excel vba

Hi Moon

Try this
http://www.rondebruin.nl/summary.htm

--
Regards Ron de Bruin
http://www.rondebruin.nl


"Moon" wrote in message oups.com...
Hi all,
I'm trying to link some cells that are in different worksheets (i have
alot of sheets) in the same workbook to a Master worksheet in the same
workbook. I'd like to use vba to do this. The cells to link to are the
same in all worksheets. So for example, in Master worksheet, I need C2
to link to sheet1.C3 and C3 to link to sheet2.C3
Can anyone point me in the right direction on how to do this?
Thanks!
Moon



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 22
Default link cells in multiple worksheets same workbook with excel vba

Hi Ron,
Thanks so much for your help! That works so perfectly. I do have
another question though that I dont have the expertise to figure out. I
have a cell that I want to link to a cell in another worksheet that is
one cell below the adjacent cell of the last entry in a column. For
example, if my last entry in column C is C5, I want to link to cell D6
This sounds pretty complicated but any help would be greatly
appreciated.
Thanks again,
Moon

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default link cells in multiple worksheets same workbook with excel vba

Hi Moon

Try this

I use The C column in Sheet2 and in the example I add the formula in the activecell

Sub test()
Dim lr As Long
lr = Sheets("sheet2").Range("C" & Rows.Count).End(xlUp).Offset(1, 0).Row
ActiveCell.Formula = _
"='Sheet2'!" & Cells(lr, "C").Address(False, False)
End Sub




--
Regards Ron de Bruin
http://www.rondebruin.nl


"Moon" wrote in message oups.com...
Hi Ron,
Thanks so much for your help! That works so perfectly. I do have
another question though that I dont have the expertise to figure out. I
have a cell that I want to link to a cell in another worksheet that is
one cell below the adjacent cell of the last entry in a column. For
example, if my last entry in column C is C5, I want to link to cell D6
This sounds pretty complicated but any help would be greatly
appreciated.
Thanks again,
Moon



  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default link cells in multiple worksheets same workbook with excel vba

Oops, you want it in D

Sub test()
Dim lr As Long
lr = Sheets("sheet2").Range("C" & Rows.Count).End(xlUp).Offset(1, 0).Row
ActiveCell.Formula = _
"='Sheet2'!" & Cells(lr, "D").Address(False, False)
End Sub



--
Regards Ron de Bruin
http://www.rondebruin.nl


"Ron de Bruin" wrote in message ...
Hi Moon

Try this

I use The C column in Sheet2 and in the example I add the formula in the activecell

Sub test()
Dim lr As Long
lr = Sheets("sheet2").Range("C" & Rows.Count).End(xlUp).Offset(1, 0).Row
ActiveCell.Formula = _
"='Sheet2'!" & Cells(lr, "C").Address(False, False)
End Sub




--
Regards Ron de Bruin
http://www.rondebruin.nl


"Moon" wrote in message oups.com...
Hi Ron,
Thanks so much for your help! That works so perfectly. I do have
another question though that I dont have the expertise to figure out. I
have a cell that I want to link to a cell in another worksheet that is
one cell below the adjacent cell of the last entry in a column. For
example, if my last entry in column C is C5, I want to link to cell D6
This sounds pretty complicated but any help would be greatly
appreciated.
Thanks again,
Moon







  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 22
Default link cells in multiple worksheets same workbook with excel vba

Hi Ron,
Thanks for the help. So I tried to link it to column D from all
worksheets into Summary-Sheet like this:

For Each myoffCell In Sh.Range("C" & Rows.Count).End(xlUp).Offset(1,
0).Row
ColNum = ColNum + 1
Newsh.Cells(RwNum, ColNum).Formula = _
"='" & Sh.Name & "'!" & Cells(lr, "D").Address(False,
False)
Next myoffCell

But For statement only works for collection or an array. I'm not sure
how to go ahead.
Thanks again,

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Copy Cells from multiple Worksheets in same workbook. OceanSS Excel Discussion (Misc queries) 2 March 16th 10 11:37 AM
Identical Cells in Multiple Worksheets in one Workbook. Randy Excel Worksheet Functions 4 October 1st 09 12:45 AM
How do I link multiple cells from another workbook? Deb T Excel Worksheet Functions 2 October 30th 08 07:11 PM
Link multiple worksheets in one workbook to another workbook and . HeatherCarr Excel Programming 0 March 28th 05 10:35 PM
Can't link cells in worksheets in same workbook Hume Waring New Users to Excel 1 December 22nd 04 09:13 PM


All times are GMT +1. The time now is 12:32 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"