Creating a directional macro
Solved/Closed
Related:
- Creating a directional macro
- Spell number in excel without macro - Guide
- Excel macro to create new sheet based on value in cells - Guide
- Create a snapchat account - Guide
- Macro excel download - Download - Spreadsheets
- How to create a bin file in windows 10 ✓ - Programming Forum
6 responses
rizvisa1
Posts
4478
Registration date
Thursday January 28, 2010
Status
Contributor
Last seen
May 5, 2022
766
Feb 2, 2010 at 05:37 PM
Feb 2, 2010 at 05:37 PM
Oh I am sorry. When you said form, I presumed you meant the excel form. It seem that you are only using sheets and not the forms (excel forms). In this case have you considered using some thing like this
This code you can write in the sheet that you are using
If you press ALT+F11, a vbe will open up
Once it opens, press CTRL + R to open project explorer window (in case it is not open already)
Expand the tree "VBAProkect(...xls) -- Microsoft Excel Objects -- then double click on the sheet where you want that functionality
Paste the code and modify as you need
Private Sub Worksheet_Change(ByVal Target As Range)
Application.EnableEvents = False
Add = Target.Address
' here you have to define how you want to move. in this sample,
' if a1 changes, i want to move to c3
' if c3 changes i want to move to d2
Select Case Add
Case "$A1$1"
Range("C3").Select
Case "$C$3"
Range("D2").Select
End Select
Application.EnableEvents = True
End Sub
This code you can write in the sheet that you are using
If you press ALT+F11, a vbe will open up
Once it opens, press CTRL + R to open project explorer window (in case it is not open already)
Expand the tree "VBAProkect(...xls) -- Microsoft Excel Objects -- then double click on the sheet where you want that functionality
Paste the code and modify as you need
Private Sub Worksheet_Change(ByVal Target As Range)
Application.EnableEvents = False
Add = Target.Address
' here you have to define how you want to move. in this sample,
' if a1 changes, i want to move to c3
' if c3 changes i want to move to d2
Select Case Add
Case "$A1$1"
Range("C3").Select
Case "$C$3"
Range("D2").Select
End Select
Application.EnableEvents = True
End Sub
rizvisa1
Posts
4478
Registration date
Thursday January 28, 2010
Status
Contributor
Last seen
May 5, 2022
766
Feb 2, 2010 at 03:55 PM
Feb 2, 2010 at 03:55 PM
This you should be able to do with the tab order. If you look at the properties of the textbox on your form, you will see an tabindex. It goes from 0 onward. You can have index set up the way you want the control to move
I'm sorry, I am not understanding what you mean. I created this in Excel, all the info. is created in cells, so I am not sure where to find the textbox properties.
rizvisa1
Posts
4478
Registration date
Thursday January 28, 2010
Status
Contributor
Last seen
May 5, 2022
766
Feb 3, 2010 at 03:59 PM
Feb 3, 2010 at 03:59 PM
mail it
Didn't find the answer you are looking for?
Ask a question
aquarelle
Posts
7141
Registration date
Saturday April 7, 2007
Status
Moderator
Last seen
December 19, 2024
491
Feb 3, 2010 at 04:06 PM
Feb 3, 2010 at 04:06 PM
Hi,
To give an excel file example (without any personal data) you should use a deposit files website like https://authentification.site and after copy/paste the created link into your next answer.
Best regards
To give an excel file example (without any personal data) you should use a deposit files website like https://authentification.site and after copy/paste the created link into your next answer.
Best regards
Feb 3, 2010 at 03:35 PM