Tabbing through a Form

G

Guest

Is there a way to set up a form so that your tabs are setup in sequential
order. The places where users will need to tab to jump around a bit, but I'd
like them to be able to fill out the form following the numberical sequence
of the form's cells. I'd also like the cursor to be in the first cell upon
opening the form and after they have finished filling in the final cell, to
have the tab sequence to start over again.

Susan Spencer
 
G

Guest

What I did was recorded a macro that selects the cells in the specific order.
Lets say I start in A1, jump down to C40, and then back to A2.

With those cells selected, i type information into A1 and hit enter and then
it jumps down to C40....hit enter again it jumps up to A2.

Will this work?

Sub AutoOpen()
Range("A1,C40,B1").Select
Range("A1").Activate
End Sub

When the file is opened by the user (assuming macro's are enabled) it will
select the cells in sequence and then they can enter their data.
 
G

Guest

Jonathan,

I have tried the macro you suggested, but it doesn't seem to work for me.
When I hit enter, it continues to go through the same sequence as always.
Here's my macro.

Sub AutoOpen()
Range("D1,D2,D3,D4,D5,F1,F2,F3,F4,F5,N1").Select
Range("D1").Activate
End Sub

I entered this into Visual Basic through the macros option box.

Susan
 
G

Guest

What happens when you run the macro?

Susan said:
Jonathan,

I have tried the macro you suggested, but it doesn't seem to work for me.
When I hit enter, it continues to go through the same sequence as always.
Here's my macro.

Sub AutoOpen()
Range("D1,D2,D3,D4,D5,F1,F2,F3,F4,F5,N1").Select
Range("D1").Activate
End Sub

I entered this into Visual Basic through the macros option box.

Susan
 
G

Guest

When I run the macro, the cells I choose are selected. It lets me begin
entering data into the first selected cell (D1), but after I enter info into
F5 and enter, it jumps to F9, instead of N1. The cell F9 would be the next
unprotected cell after F5.

Susan
 
G

Guest

I ran your macro on my machine. Starting in D1, when I hit ENTER, I get the
following sequence.

D2,D3,D4,D5,F1,F2,F3,F4,F5,N1

and if I hit enter again, it goes back to D1.

Shouldn't go to F9 at all.
 
G

Guest

I checked again and found that I had cell F5 locked. It now works correctly.
Thank you. I have a problem with my form now, since adding this macro.
After running the macro, I tried to fill in the rest of the form's cells that
aren't a part of the macro. There are checkmark boxes that are programmed
with visual basic to transfer the data from each row that is checkmarked to
another sheet within the same workbook. When I click a checkmark box now, I
get the error message: "Compile error: Sub or Function not defined." I
click OK and then it takes me to my VB programming:

Private Sub CheckBox5_Change() (This is highlighted in yellow)
Call startstop (This is selected with blue)

Is there another step I need to do, or does this macro need to be inserted
into my VB code somewhere.

Susan
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top