ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Can use arrows after App.InputBox (https://www.excelbanter.com/excel-programming/331633-can-use-arrows-after-app-inputbox.html)

Steph[_3_]

Can use arrows after App.InputBox
 
Hi everyone. When I execute the code below, it prompts an Input box for
data entry. If I hit cancel or if I enter data into the inputbox, the arrow
keys on my keyboard no longer work. If I click on a different sheet, then
back to this one, it now works! Any idea why? Thanks.


Sub Overwrite()
Dim userid As Variant

If ActiveCell.Column < 5 Or ActiveCell.Row < 5 Then
MsgBox ("Active Cell must be on the User ID you wish to change")
Else
userid = Application.InputBox("New User ID")
If userid = False Then
Exit Sub
Else
'Unprotect HR DB
Data.Unprotect Password
ActiveCell.Value = userid
'Protect HR DB
Data.Unprotect Password
Data.Protect Password, True, True, True, True
End If
End If
End Sub



Steph[_3_]

Can use arrows after App.InputBox
 
Never mind. Focus issue. Sheet1.Select did it. Thanks anyway!

"Steph" wrote in message
...
Hi everyone. When I execute the code below, it prompts an Input box for
data entry. If I hit cancel or if I enter data into the inputbox, the

arrow
keys on my keyboard no longer work. If I click on a different sheet, then
back to this one, it now works! Any idea why? Thanks.


Sub Overwrite()
Dim userid As Variant

If ActiveCell.Column < 5 Or ActiveCell.Row < 5 Then
MsgBox ("Active Cell must be on the User ID you wish to change")
Else
userid = Application.InputBox("New User ID")
If userid = False Then
Exit Sub
Else
'Unprotect HR DB
Data.Unprotect Password
ActiveCell.Value = userid
'Protect HR DB
Data.Unprotect Password
Data.Protect Password, True, True, True, True
End If
End If
End Sub






All times are GMT +1. The time now is 02:45 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com