Inquiridor
Eliminar a necessidade de teclar ENTER

Pergunta
-
Todas as Respostas
-
GENECIOFICIAL,
Talvez isso te ajude...
=========================================
Excel / Pular para próxima célula automaticamente
Por KaduFregossi, 9 de outubro de 2013 em Microsoft Office
https://www.clubedohardware.com.br/forums/topic/1046579-excel-pular-para-pr%C3%B3xima-c%C3%A9lula-automaticamente/
=========================================
Private Sub Worksheet_Change(ByVal Target As Range) Dim cell As Excel.Range 'exemplo na coluna A If Not Intersect(Target, Columns("A")) Is Nothing Then For Each cell In Intersect(Target, Columns("A")) If Len(cell.Value) > 1 Then cell.Value = Left(cell.Value, 1) cell.Select MsgBox "Digite apenas 1 caractere na célula" End If Next cell End If End Sub
[]'s,
Fabio I. -
-
GENECIOFICIAL,
A rotina abaixo funciona, independente da célula.Private Sub Worksheet_Change(ByVal Target As Excel.Range) If Len(Target.Value) > 8 Then Target.Value = Left(Target.Value, 8) End If End Sub
Baseado no 'post':
===============================
keydown event
https://www.excelforum.com/excel-programming-vba-macros/363557-keydown-event.html
===============================Veja também:
===============================
How can I define ENTER keypressed event for a dynamically chosen Cell in VBA for Excel
Sub recordEnterKeypress() enterWasPressed = True End Sub Private Sub Worksheet_Change(ByVal Target As Range) If enterWasPressed _ And Not Intersect(Target, Range("A1")) Is Nothing Then MsgBox "You just modified cell A1 and pressed Enter." End If enterWasPressed = False 'reset it End Sub
https://stackoverflow.com/questions/9377237/how-can-i-define-enter-keypressed-event-for-a-dynamically-chosen-cell-in-vba-for
===============================Keypress event in a cell - Free Excel\VBA Help Forum - OzGrid.com
https://www.ozgrid.com/forum/forum/help-forums/excel-general/38704-keypress-event-in-a-cell
===============================Examples for Visual Basic for Application accessing the Windows API: key press
https://renenyffenegger.ch/notes/development/languages/VBA/Win-API/examples/key-press
===============================[]'s,
Fabio I.- Editado Fabio I terça-feira, 22 de outubro de 2019 11:32