Hi guys
I am doing a programme at work and I am struggling to finish the macro.
I am running a macro in a cell (j8), but I want to offset to the cell to the right and insert the following formula:
=J8-((three worksheets to the left)J8)
The formula i have is below
Function addValue(number) 'Add value into the value box
x = ActiveSheet.Name 'active worksheet denotated as x
If (number >= 0) Then
Sheets(x).Activate
Worksheets(x).Cells(8, 10) = number
addValue = True
Else
addValue = False
End If
Range("K8").Select
ActiveCell.FormulaR1C1 = "=RC[-1]-sheets(sheetcount-2)RC[-1]"
End Function
If anyone can help it would be massively appreciated.
Kind regards
Storer
I am doing a programme at work and I am struggling to finish the macro.
I am running a macro in a cell (j8), but I want to offset to the cell to the right and insert the following formula:
=J8-((three worksheets to the left)J8)
The formula i have is below
Function addValue(number) 'Add value into the value box
x = ActiveSheet.Name 'active worksheet denotated as x
If (number >= 0) Then
Sheets(x).Activate
Worksheets(x).Cells(8, 10) = number
addValue = True
Else
addValue = False
End If
Range("K8").Select
ActiveCell.FormulaR1C1 = "=RC[-1]-sheets(sheetcount-2)RC[-1]"
End Function
If anyone can help it would be massively appreciated.
Kind regards
Storer