.Formula with cells from different sheets

BYUIStudent

New Member
Joined
Jun 25, 2015
Messages
10
Hello Everyone and once again thank you for all your help.

I am trying to use activecell.formula however a few of the cells I need referenced are from different sheets then the one I am currently in and when I used cell.address it puts the address in but for the sheet I am working in.

Here is the code:

Function CreateFunction ()
Dim MinPoint As Range, DateOffset As Range, MatrixOffset As Range

Sheets("Raw Data").Select

Set MinPoint = Range("MinData").Offset(1, 0)
Set DateOffset = Range("SPX_2").Offset(2, -1)


Sheets("Correlation").select
Set MatrixOffset = Range("Matrix").Offset(0, -2)

range("Matrix").activate

activecell.Formula = "=if(" + MatrixOffset.Address(False, False) + "<=" + MinPoint.Address + "-1,offset(" + DateOffset.Address(False, False) + ",0,$e$3),"""")"

End Function

In this case the MinPoint and DateOffset ranges are from different sheets. But as I said I get their address for the sheet the formula is being written into. Any help would be great Thank You so much for your time and efforts.

BYUIStudent
 

Excel Facts

Easy bullets in Excel
If you have a numeric keypad, press Alt+7 on numeric keypad to type a bullet in Excel.
So I figured I could just add the name of the page before the address ie "=if('Raw Data'!" + Matrixoffset.address..... so on and so forth. But is there an easier way?
 
Upvote 0

Forum statistics

Threads
1,215,724
Messages
6,126,477
Members
449,315
Latest member
misterzim

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top