Hello all,
Can you please add something in the code?
After the message box appear and when I click "OK" then it will go directly to AI5.
Thanks in advance :o)
![]()
Please Login or Register to view this content.
Hello all,
Can you please add something in the code?
After the message box appear and when I click "OK" then it will go directly to AI5.
Thanks in advance :o)
![]()
Please Login or Register to view this content.
How about...
![]()
Please Login or Register to view this content.
HTH
Regards, Jeff
Hi Jeffrey,
I did put the code but when I click "OK" after the message box it went to the AI5 and it pass it.
Thanks.
Oh... I just notice that if I use the mouse to click "OK" then it does goes in the AI5 but I if I use the "enter" key then it pass it.
Can you please fix it so I am able to use the enter key as well.
Thank you
Whether I use the Ok button or hit enter, the cursor still goes to AI5.
Could something you are doing from your other thread getting in the way?
Remove some of the other code and then try. Again, it works for me by going directly to AI5 when hitting enter.
Hi
I removed the
Target,Select
In the code and it works.
Is it possible to have the cells be in order when I press the enter key after the entry in AI5.
Let say AI5, then when i press enter it woll go to H10, J15
And N20.
Something like this
I have not idea what this means. What do you mean when you press the enter key.
The code only triggers off of cell J4. Are you saying as you change the value in J4 again you want another cell selected?
Based on what? A value already in AI5?
Remember, this is your project so you have to do a little more explaining so we can understand.
Hi Sorry,
I will try.
Since the cursor is in AI5, after J4...
After I enter the date in AI5 i want my next entry to go to H10 then next to J15, etc. by pressing the enter key.
Thanks
Sorry. Not sure how to approach this.
Is this what you mean![]()
Please Login or Register to view this content.
Hi Fluff13
This is exactly what I was looking for. Question, so this code does only for the Enter Key. Can it be done both for Enter and Tab key?
So when the user use press either enter/tab key will work same. As of now, when I tried using the enter key, it works as I wish for but when I try to use the tab key, it does not do the same as the enter key.
Thanks :o)
As long as you have entered the cell (F2 or doubleclick) the code will fire regardless of how you leave the cell.
Hi
Ok... Here is my issue. I attached the file.
If I use the tab key and I click "OK" it does what it supposed to do according to the code. No problem using the tab key.
Now the issue here is the Enter key.
Try to enter 1234 at the Item # box and press enter or click "OK" and you will see that the Received box will automatically check and the cursor stopped at N10. The cursor should go to next cell (AI5) when you click "OK" and no check box should be mark. And, it should goes to next cell according to the VBA code.
Also, according to the last code (see below) that my last cell is Q44 and it should return to the J4 not AI5.
Please fix.![]()
Please Login or Register to view this content.
Thank in advance.
Last edited by RJ1969; 04-20-2019 at 10:12 PM.
With all those different event codes it's difficult to figure out what's going on.
Why you get different behaviour depending on whether you Tab or Enter I'm not sure.
The problem is when you "tab" the next available cell will be selected.
When you "Enter", the selection will be the next available cell down.
When you hit enter, L10 becomes the target cell. Selecting AI5 is too late,
the code still has to process L10 in the selection_change events.
One idea I have would be to check if the previous target address was J4 and
the current target address is L10, if they equal, then select AI5 and exit the selection_change event.
.
.
Get targetaddress.jpg
Check it the target ranges match
.
TargetAddress.jpg
.
![]()
Please Login or Register to view this content.
Last edited by davesexcel; 04-21-2019 at 10:38 AM.
Hi davesexcel,
I tried. Still doesn't accomplish what I really wish to do in the worksheet.
Here is the scenario.
Type something in the item box "1234" press the tab key (msg box) will come up, then the cursor will stop in AI5 and now just keep tabbing the key and you will notice that the cursor is going in order as you tab it.
Did you see how the cursor goes from J4 to AI5 to R38 to U41 to Q44 then it return back to the beginning J4.
This is exactly what I want to do with the enter key. If you try the scenario using the enter key then you notice the differences between the tab key and the enter key.
Thanks.
You have added VBA that controls where you "Tab" to, that would be why it is not selecting the other unlocked cells as you tab along.
Administrative Note:
Welcome to the forum.
We would love to help you with your query; however, it has been brought to our attention the same query has been posted on one or more other forums and you have not provided the required cross-post link(s) here.
http://www.vbaexpress.com/forum/show...045-ICOLOR-TAB
Read this to understand why we (and other sites like us) consider this to be important.
(Note: this requirement is not optional. No help to be offered until the link is provided.)
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks