That is what declaring it as public is doing. Here is some further clarification/ working proof of the same thing I showed earlier.
Option Explicit
Public lastrow As Long
Sub Main_Macro()
Call Module_1
Call Module_2
End Sub
Sub Module_1()
lastrow = Sheets("Sheet1").Range("A" & Rows.Count).End(xlUp).Row
'lastrow starts at 4
Debug.Print lastrow
End Sub
Sub Module_2()
Dim i As Integer
For i = 1 To 3
Sheets("Sheet1").Range("A" & Rows.Count).End(xlUp).Offset(1, 0).Value = "test"
Next i
MsgBox (lastrow) 'returns 4
Debug.Print Sheets("Sheet1").Range("A" & Rows.Count).End(xlUp).Row 'returns 7
End Sub
Bookmarks