General discussion


Data Entry Macro

By audit ·
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.

This conversation is currently closed to new comments.

Thread display: Collapse - | Expand +

All Comments

Collapse -

Data Entry Macro

by DKlippert In reply to Data Entry Macro

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)
End Sub

Collapse -

Data Entry Macro

by audit In reply to Data Entry Macro

Poster rated this answer

Related Discussions

Related Forums