Closed Thread
Results 1 to 4 of 4

use Simple Macro

  1. #1
    MAStew
    Guest

    use Simple Macro

    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

  2. #2
    Trevor Shuttleworth
    Guest

    re: use Simple Macro

    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


    "MAStew" <MAStew@discussions.microsoft.com> wrote in message
    news:7C2FD4AE-602B-4DE3-9408-E80CB1DD95BB@microsoft.com...
    >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




  3. #3
    MAStew
    Guest

    re: use Simple Macro

    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

    "MAStew" wrote:

    > 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


  4. #4
    Don Guillett
    Guest

    re: use Simple Macro

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

    --
    Don Guillett
    SalesAid Software
    dguillett1@austin.rr.com
    "MAStew" <MAStew@discussions.microsoft.com> wrote in message
    news:7C2FD4AE-602B-4DE3-9408-E80CB1DD95BB@microsoft.com...
    >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




Closed Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1