Hello,
All I need, is to be able to call the public variable 'lastrow2' from the module it is defined in to the sheet 1 object. I have the following code:
IN THE 'Sheet1(Drawings List)' OBJECT [I have omitted some irrelevant code]:
IN 'Module2' I simply have this:
The public variable seems to work in 'Module1' and updates its value, but not in the sheet1 object code.
Any help would be appreciated, thanks
All I need, is to be able to call the public variable 'lastrow2' from the module it is defined in to the sheet 1 object. I have the following code:
IN THE 'Sheet1(Drawings List)' OBJECT [I have omitted some irrelevant code]:
Code:
Private Sub Worksheet_Change(ByVal Target As Range)
Dim lastrow As Long
Dim wb As String
wb = Workbooks(1).Name
If ThisWorkbook.Name = "DRAWINGS LIST UPDATE3.xlsm" Then
lastrow = Worksheets("Drawings List").Range("A" & Rows.Count).End(xlUp).ROW
If Not Target.Address <> "$A$" & lastrow And lastrow2 < lastrow Then
Fill_In_Info lastrow
End If
End If
End Sub
IN 'Module2' I simply have this:
Code:
Public DWGsinDP As Long
Public DWGsinDP2 As Long
Public lastrow2 As Long
The public variable seems to work in 'Module1' and updates its value, but not in the sheet1 object code.
Any help would be appreciated, thanks