I am in need of a better way to declare this variable without actually selecting the cell.
Issue I am having is in this range I also have another code activate a userform when a cell in this range is selected.
I need the code to search/find the last cell used in the range and then declare the contents of that cell to globTime without opening the userform.
OR
what am I doing wrong to close this userform (Unload frmTime1)
Issue I am having is in this range I also have another code activate a userform when a cell in this range is selected.
I need the code to search/find the last cell used in the range and then declare the contents of that cell to globTime without opening the userform.
OR
what am I doing wrong to close this userform (Unload frmTime1)
VBA Code:
'Activate userform when cell is selected
If Not Application.Intersect(Target, Range("TimeLedger")) Is Nothing Then
frmTime1.Show
End If
VBA Code:
'get the last end time for nextjob start time
Dim xLastRow As Long
With Application.ActiveSheet.Range("EndTimeCol")
xLastRow = .Cells(.Rows.Count, "a").End(xlUp).Select
End With
Unload frmTime1 [B]'This is not unloading the userform when it pops up[/B]
globTime = ActiveCell.Value 'This variable public declared (as Double)