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
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