Simple Macro

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I am a long time lotus user and am now required to use Excell. I wrote my
first macro--a very simple one, but I want it to continue until I tell it to
stop. It runs through and doesn't complete a loop.

Here is the Macro:
ActiveCell.Value = InputBox("EnterValue")
ActiveCell.Offset(0, 1).Select
ActiveCell.Value = InputBox("EnterValue")
ActiveCell.Offset(0, 1).Select
ActiveCell.Value = InputBox("EnterValue")
ActiveCell.Offset(0, 1).Select
ActiveCell.Value = InputBox("EnterValue")
ActiveCell.Offset(0, 1).Select
ActiveCell.Value = InputBox("EnterValue")
ActiveCell.Offset(0, 1).Select
ActiveCell.Value = InputBox("EnterValue")
ActiveCell.Offset(0, 1).Select
ActiveCell.Value = InputBox("EnterValue")
ActiveCell.Offset(0, 1).Select
ActiveCell.Value = InputBox("EnterValue")
ActiveCell.Offset(0, 1).Select
ActiveCell.Value = "x"
ActiveCell.Offset(0, 1).Select
ActiveCell.Value = InputBox("EnterValue")
ActiveCell.Offset(1, 0).Select
Selection.End(xlToLeft).Select
Do While ActiveCell.Value = (blank)
Loop
End Sub
 
Not entirely sure what your data might look like or what you want to achieve
but try this:

Do While ActiveCell.Value = ""
ActiveCell.Value = InputBox("EnterValue")
ActiveCell.Offset(0, 1).Select
ActiveCell.Value = InputBox("EnterValue")
ActiveCell.Offset(0, 1).Select
ActiveCell.Value = InputBox("EnterValue")
ActiveCell.Offset(0, 1).Select
ActiveCell.Value = InputBox("EnterValue")
ActiveCell.Offset(0, 1).Select
ActiveCell.Value = InputBox("EnterValue")
ActiveCell.Offset(0, 1).Select
ActiveCell.Value = InputBox("EnterValue")
ActiveCell.Offset(0, 1).Select
ActiveCell.Value = InputBox("EnterValue")
ActiveCell.Offset(0, 1).Select
ActiveCell.Value = InputBox("EnterValue")
ActiveCell.Offset(0, 1).Select
ActiveCell.Value = "x"
ActiveCell.Offset(0, 1).Select
ActiveCell.Value = InputBox("EnterValue")
ActiveCell.Offset(1, 0).Select
Selection.End(xlToLeft).Select
Loop

Regards

Trevor
 
Trevor,
It's just a macro to do data entry, which is just the first part of my
worksheet. I wasn't a great macro writer before, but am now really stumped.
Thank you for your help, this worked.

MA
 
Sub fillformsimple()
For i = 2 To Cells(Rows.Count, "g").End(xlUp).Row
Cells(i, "h") = InputBox("enter value")
Next i
End Sub
 
Back
Top