Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 158
Default MACRO QUESTION ????

On Aug 14, 3:42*pm, Gord Dibben <gorddibbATshawDOTca wrote:
Steven

It is sheet event code and runs when data is entered into the cells in the
aTabOrd Array

Right-click on the sheet tab and "View Code"

Copy/paste the code into that sheet module.

Adjust ranges to suit then Alt + q to return to the Excel window.

Gord

On Thu, 14 Aug 2008 11:38:14 -0700 (PDT), wrote:
On Aug 14, 12:29*pm, Gord Dibben <gorddibbATshawDOTca wrote:
Private Sub Worksheet_Change(ByVal Target As Range)
'Anne Troy's taborder event code
* * Dim aTabOrd As Variant
* * Dim i As Long


* * *'Set the tab order of input cells
* * aTabOrd = Array("A5", "B2", "C5", "A10", "B3", "C10")


* * *'Loop through the array of cell address
* * For i = LBound(aTabOrd) To UBound(aTabOrd)
* * * * *'If the cell that's changed is in the array
* * * * If aTabOrd(i) = Target.Address(0, 0) Then
* * * * * * *'If the cell that's changed is the last in the array
* * * * * * If i = UBound(aTabOrd) Then
* * * * * * * * *'Select first cell in the array
* * * * * * * * Me.Range(aTabOrd(LBound(aTabOrd))).Select
* * * * * * Else
* * * * * * * * *'Select next cell in the array
* * * * * * * * Me.Range(aTabOrd(i + 1)).Select
* * * * * * End If
* * * * End If
* * Next i


End Sub


Gord Dibben *MS Excel MVP


On Thu, 14 Aug 2008 07:14:16 -0700, JAYC099


wrote:
No, it was an example, I have several cells on my document that I need to
jump from left to right and top to bottom...
Thx


"Tim" wrote:


if it is always just those two, you could lock all the other cells (ie,
without using VBA)


"JAYC099" wrote in message
...
HI, I NEED TO KNOW HOW TO MOVE FROM : C5 TO D8 BY PRESSING TAB A SINGLE
TIME


Gord:


How do you run this code? I can't seem to activate it.


Steven


Great, thank you Gord. I see how it works. I've never used a Private
Sub before.

S
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Excel 2007 Macro/VB Question DDE Question MadDog22 Excel Worksheet Functions 1 March 10th 10 01:47 AM
Macro Question ddbro Excel Discussion (Misc queries) 4 August 1st 08 08:26 PM
Macro If Then Question mslabbe Excel Programming 4 January 28th 08 08:02 PM
Macro Question Rodney Excel Programming 2 September 26th 07 12:20 PM
one last macro question Michael A Excel Programming 3 March 7th 05 03:55 AM


All times are GMT +1. The time now is 04:15 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"