Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
G G is offline
external usenet poster
 
Posts: 52
Default Programmable Column Sequencing?

I am currently using Excel 2003 and 2007 if necessary.

I would like the ability to configure the excel sheet column sequencing when
I hit the enter key or tab key. Is this possible?? Any suggestions???


Thank You,

G
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,565
Default Programmable Column Sequencing?

Can you illustrate what you mean by column sequencing? Do you mean
rearrange the column header designation or do you mean sort the data in the
columns or do you mean move the data in the columns from one column to
another? Examples help.



"G" wrote in message
...
I am currently using Excel 2003 and 2007 if necessary.

I would like the ability to configure the excel sheet column sequencing
when
I hit the enter key or tab key. Is this possible?? Any suggestions???


Thank You,

G



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 21
Default Programmable Column Sequencing?

OssieMac, your code will surely render the workbook inoperable, as each
select statement will trigger the change event, resulting in an infinite loop.

May I offer a modification:
Private Sub Worksheet_Change(ByVal Target As Range)

Dim strCol As String
Static Recursed as Booelan
if recursed then exit sub
recursed = true


'Assign the column Alpha Id to variable
strCol = Split(Columns(Target.Column) _
.Address(, 0), ":")(1)

Select Case strCol
Case "A"
Cells(Target.Row, "D").Select

Case "B"
Cells(Target.Row, "E").Select

Case "C"
Cells(Target.Row, "K").Select

Case "AB"
Cells(Target.Row, "AZ").Select

End Select
recursed = false

End Sub

Best,

  #4   Report Post  
Posted to microsoft.public.excel.programming
GS GS is offline
external usenet poster
 
Posts: 364
Default Programmable Column Sequencing?

Adding to JGLWhiz's suggestion...

I would insert a 'program row' (ie: hidden) at the top of the sheet
(Rows(1)), where you can enter the column label for the target cell.
Then use a single statement inside an If construct as follows:

Private Sub Worksheet_Change(ByVal Target As Range)
If Not Cells(1, Target.Column) = "" Then
Cells(Target.Row, Cells(1, Target.Column).Text).Select
End If
End Sub

HTH

--
Garry

Free usenet access at http://www.eternal-september.org
ClassicVB Users Regroup! comp.lang.basic.visual.misc


  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,510
Default Programmable Column Sequencing?

Hi,

I don't think there is any way of just setting a tab order on the worksheet
but if you are actually entering and/or changing data on the worksheet then
the following code will select the cell in the next required column on the
same row.

Not sure how savvy you are with VBA but to install the code, right click on
the worksheet tab name and select View Code. Copy the code and paste into the
VBA editor. Click the red cross at top right of VBA editor to close the
editor.

Just edit the case statements and the following line for the required order.
Add more case statements as required before the End Select line.

Private Sub Worksheet_Change(ByVal Target As Range)

Dim strCol As String

'Assign the column Alpha Id to variable
strCol = Split(Columns(Target.Column) _
.Address(, 0), ":")(1)

Select Case strCol
Case "A"
Cells(Target.Row, "D").Select

Case "B"
Cells(Target.Row, "E").Select

Case "C"
Cells(Target.Row, "K").Select

Case "AB"
Cells(Target.Row, "AZ").Select

End Select

End Sub

--
Regards,

OssieMac



  #6   Report Post  
Posted to microsoft.public.excel.programming
G G is offline
external usenet poster
 
Posts: 52
Default Programmable Column Sequencing?

Lets say we have 5 columns (A,B,C,D,E). Normally, When you are in column A,

when you hit the Tab Key it goes to column B, then Column C. I like a way
to rearrange the order. For example if I am in Column A, and hit a tab, I
may want to go to Column D, and then Column E.

I hope that helps.


G


"JLGWhiz" wrote:

Can you illustrate what you mean by column sequencing? Do you mean
rearrange the column header designation or do you mean sort the data in the
columns or do you mean move the data in the columns from one column to
another? Examples help.



"G" wrote in message
...
I am currently using Excel 2003 and 2007 if necessary.

I would like the ability to configure the excel sheet column sequencing
when
I hit the enter key or tab key. Is this possible?? Any suggestions???


Thank You,

G



.

  #7   Report Post  
Posted to microsoft.public.excel.programming
GS GS is offline
external usenet poster
 
Posts: 364
Default Programmable Column Sequencing?

G explained on 5/27/2010 :
Lets say we have 5 columns (A,B,C,D,E). Normally, When you are in column A,

when you hit the Tab Key it goes to column B, then Column C. I like a way
to rearrange the order. For example if I am in Column A, and hit a tab, I
may want to go to Column D, and then Column E.

I hope that helps.


G


"JLGWhiz" wrote:

Can you illustrate what you mean by column sequencing? Do you mean
rearrange the column header designation or do you mean sort the data in the
columns or do you mean move the data in the columns from one column to
another? Examples help.



"G" wrote in message
...
I am currently using Excel 2003 and 2007 if necessary.

I would like the ability to configure the excel sheet column sequencing
when
I hit the enter key or tab key. Is this possible?? Any suggestions???


Thank You,

G



.


My suggestion works when you leave edit mode in the cell, however that
happens. That means whether you use the Tab, Enter, or arrow keys it
selects whatever column a label has been entered in the first row. For
example, to have the active cell move to ColD from ColA, enter D in the
first row of ColA. Otherwise, tab behavior will behave normally if
nothing is entered in the first row of any column.

--
Garry

Free usenet access at http://www.eternal-september.org
ClassicVB Users Regroup! comp.lang.basic.visual.misc


  #8   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,510
Default Programmable Column Sequencing?

Hakyab,

I've been away and hense did not get back to this sooner. However, I think
you are confusing Worksheet_SelectionChange with Worksheet_Change. The code I
posted only fires if an actual change is made to the data in the cell. I
included the following to clarify this "if you are actually entering and/or
changing data on the worksheet"

I tested the code before posting.

--
Regards,

OssieMac


"Hakyab" wrote:

OssieMac, your code will surely render the workbook inoperable, as each
select statement will trigger the change event, resulting in an infinite loop.

May I offer a modification:
Private Sub Worksheet_Change(ByVal Target As Range)

Dim strCol As String
Static Recursed as Booelan
if recursed then exit sub
recursed = true


'Assign the column Alpha Id to variable
strCol = Split(Columns(Target.Column) _
.Address(, 0), ":")(1)

Select Case strCol
Case "A"
Cells(Target.Row, "D").Select

Case "B"
Cells(Target.Row, "E").Select

Case "C"
Cells(Target.Row, "K").Select

Case "AB"
Cells(Target.Row, "AZ").Select

End Select
recursed = false

End Sub

Best,

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
Programmable Column Sequencing? G Excel Discussion (Misc queries) 2 May 27th 10 09:56 PM
Not Sequencing JAD Excel Programming 3 October 8th 08 08:09 PM
sequencing numbers barb Excel Programming 5 July 7th 08 10:56 PM
Row Sequencing Mark Excel Worksheet Functions 8 August 18th 05 06:33 PM
Programmable Web Query RCarroll Excel Programming 1 September 12th 03 08:25 PM


All times are GMT +1. The time now is 03:28 PM.

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

About Us

"It's about Microsoft Excel"