KiwiMattNZ
New Member
- Joined
- Feb 21, 2011
- Messages
- 5
Hi
Am hoping this is just a simple fix.
I have a user form with 3 textboxes linked to cell which need add up to 100. When a user has entered all 3 numbers there is a button which does a check.
All works fine if the user pushes enter or moves to a different text box.
If however after getting the 3 boxes to balance to 100, they change one of the numbers and do not push enter or select another box, the check takes the old result and flows through, then updates the three linked cells in the spreadsheet.
Any idea arround forcing a calculation would be great, I have tried doing a spreadsheet calculate at different points but to no avail.
Cheers
Matt
Private Sub Image5_Click()
' Turns off screenupdating
With Application
.ScreenUpdating = False
End With
' Selects sheet where check is
Sheets("dvCheckSheet").Select
Range("D21").Select
' Runs check
If ActiveCell = True Then
' If balances
Unload frmTrackedSurcharge
Sheets("mnMain").Select
With Application
.ScreenUpdating = True
.StatusBar = False
End With
Exit Sub
Else
' If not in balance. advices user
MsgBox "Your percentages do not add up to 100%. Please check"
Sheets("mnMain").Select
With Application
.ScreenUpdating = True
End With
End If
End Sub
Am hoping this is just a simple fix.
I have a user form with 3 textboxes linked to cell which need add up to 100. When a user has entered all 3 numbers there is a button which does a check.
All works fine if the user pushes enter or moves to a different text box.
If however after getting the 3 boxes to balance to 100, they change one of the numbers and do not push enter or select another box, the check takes the old result and flows through, then updates the three linked cells in the spreadsheet.
Any idea arround forcing a calculation would be great, I have tried doing a spreadsheet calculate at different points but to no avail.
Cheers
Matt
Private Sub Image5_Click()
' Turns off screenupdating
With Application
.ScreenUpdating = False
End With
' Selects sheet where check is
Sheets("dvCheckSheet").Select
Range("D21").Select
' Runs check
If ActiveCell = True Then
' If balances
Unload frmTrackedSurcharge
Sheets("mnMain").Select
With Application
.ScreenUpdating = True
.StatusBar = False
End With
Exit Sub
Else
' If not in balance. advices user
MsgBox "Your percentages do not add up to 100%. Please check"
Sheets("mnMain").Select
With Application
.ScreenUpdating = True
End With
End If
End Sub