Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   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 09:33 PM.

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"