I guess the quickest way to do this is to declare LastRow1 and LastRow2 as public variables. Like this:

[VBA]
Public PublicVariable As String
Public LastRow2 As Integer
Public LastRow1 As Integer
Sub sample1()
LastRow2 = 10
LastRow1 = 2
PublicVariable = "=(35*(5-H" & LastRow2 & "))-H" & LastRow1
sample2
End Sub
[/VBA]

[VBA]
Sub sample2()
Cells(2, 10).Formula = PublicVariable
End Sub
[/VBA]

Then you can simple reassign LastRow1 and LastRow2 either in sub1 or sub2.