theguyIsHere
New Member
- Joined
- Oct 2, 2013
- Messages
- 19
- Office Version
- 2019
- Platform
- MacOS
I am using the code below to show me the largest number in column B in the status bar.
I would be grateful if you can guide me on:
1 - How do I add +1 to the max number
2 - The status bar automatically refreshes itself with the next highest number when a user enters a maximum number
Thank you
VBA Code:
Sub Return_highest_number()
'declare a variable
Dim ws As Worksheet
Set ws = Worksheets("Gantt table")
'return highest number in a range
Application.StatusBar = "Next ID = " & Application.WorksheetFunction.Max(ws.Range("B2:B99"))
End Sub
I would be grateful if you can guide me on:
1 - How do I add +1 to the max number
2 - The status bar automatically refreshes itself with the next highest number when a user enters a maximum number
Thank you