Discussion Locked

Data Entry Macro

0 helpful
2 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.
How do you get a macro in VBA to pause for data entry? I tried to record a macro that moves from the first cell requiring data through the last cell that requires data. However it doesn't interpet my input as a pause for data entry {?}. Instead, when the macro is run, the cursor moves from the first cell to the next until it reaches the last cell and the macro terminates.

2 replies

by dklippert

Here's a macro i picked up somewhere:
Sub EnterRows136()
Dim i As Variant
Dim myCol As Long
Dim myArray As Variant
Dim myResponse As Variant
myArray = Array(1, 3, 6)

myResponse = vbYes
myCol = ActiveCell.Column
While myResponse = vbYes
For Each i In myArray
Cells(i, myCol).Value = _
Application.InputBox("Enter value for Row " & i & " of Column " & _
Mid(Cells(i, myCol).Address, 2, InStr(2, Cells(i, myCol).Address, "$") - 2))
Next i
myCol = myCol + 1
myResponse = MsgBox("Continue?", vbYesNo)
Wend
End Sub

This discussion is closed to new replies.