Macro to move from cell to cell after entering data
Macro to move from cell to cell after entering data
Thanks Thanks:  0
Likes Likes:  0
Results 1 to 3 of 3

Thread: Macro to move from cell to cell after entering data

  1. #1
    New Member
    Join Date
    Feb 2002
    Posts
    2
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

     
    I have created a form used to confirm orders. I would like to make a macro to move from cell to cell after data has been entered. For example, the macro would go to cell A1 where data such as name would be entered, them move to cell A5 where address would be entered then to cell a6 where city would be entered and so on.

    Thanks.

  2. #2
    New Member
    Join Date
    Feb 2002
    Posts
    4
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    This is a copy of a portion of a macro that I use to enter data into consecutive columns. Note: Active cell.offset (row, column) tells the cursor where you want to go. For example . Active cell.offset (1,1) tells the macro to go down one row and over one column.


    sub enterdata ()

    inputdata:
    ActiveCell = InputBox("Date?", vbOKCancel)
    ActiveCell.Offset(0, 1).Select
    ActiveCell = InputBox("Invoice Number?", vbOKCancel)
    ActiveCell.Offset(0, 1).Select
    ActiveCell = InputBox("Amount Paid?", vbOKCancel)
    ActiveCell.Offset(1, -1).Select
    Selection.End(xlToLeft).Select
    ans = MsgBox("Do you Want to Key Another?", vbYesNo)
    If ans = vbYes Then
    GoTo inputdata
    Else: Exit Sub
    End If



    Good Luck!

  3. #3
    MrExcel MVP Damon Ostrander's Avatar
    Join Date
    Feb 2002
    Location
    Denver, Colorado USA
    Posts
    4,240
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

      
    Hi Steve,

    One of the easiest ways to do this is to simply unlock all the cells that data may be entered into. You can do this by selecting them (Ctrl-click on each cell in succession), then go to Format -> Cells -> Protection tab, uncheck the Locked checkbox.

    Then protect the whole worksheet (Tools -> Protection -> Protect Sheet). Just make sure to write down the password if you assign one.

    Once you have done this, control will always skip to the next unlocked cell when you tab or enter data.
    Keep Excelling.

    Damon

    VBAexpert Excel Consulting
    LinkedIn Profile http://www.linkedin.com/pub/damon-ostrander/7/79/a93
    AllExperts Profile http://www.allexperts.com/ep/1059-30...-Ostrander.htm

User Tag List

Like this thread? Share it with others

Like this thread? Share it with others

Posting Permissions

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

 

 
DMCA.com