A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Excel » General Discussion
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

BIG question



 
 
Thread Tools Display Modes
  #11  
Old June 14th, 2009, 10:33 PM posted to microsoft.public.excel.misc
Harlan Grove[_2_]
external usenet poster
 
Posts: 1,439
Default BIG question

"Rick Rothstein" wrote...
I believe this shorter code will function identically to the code you
posted...

Private Sub Worksheet_Change(ByVal Target As Range)
* ' Set the tab order of input cells in a space delimited list
* Const aTabOrd As String = "A5 B22 C5 A11 D10 F7"
* On Error Resume Next
* Range(Trim(Split(Split(aTabOrd & " " & aTabOrd, Target.Address(0, 0) _
* * * & " ", , vbTextCompare)(1))(0))).Select
End Sub

....

Close. Make the C5 address in aTabOrder AC5 instead, then enter
something in C5. FUBAR!

Make the .Select method call

Range(Trim(Split(Split(" " & aTabOrd & " " & aTabOrd, _
" " & Target.Address(0, 0) & " ", , vbTextCompare)(1))(0))).Select

Delimiters are a pain.
  #12  
Old June 15th, 2009, 02:58 AM posted to microsoft.public.excel.misc
Rick Rothstein[_2_]
external usenet poster
 
Posts: 2,013
Default BIG question

Do you know what annoys me about your posting? The fact that you had to post
it in the first place. I've given that same correction you gave me to others
dozens of times in the past myself (both when volunteering here as well as
when I volunteered in the compiled VB newsgroups)! I was concentrating on
getting the wrap-around effect and completely overlooked the partial match
problem (for which I could just kick myself). Anyway, thanks for catching
this... I really appreciate it.

--
Rick (MVP - Excel)


"Harlan Grove" wrote in message
...
"Rick Rothstein" wrote...
I believe this shorter code will function identically to the code you
posted...

Private Sub Worksheet_Change(ByVal Target As Range)
' Set the tab order of input cells in a space delimited list
Const aTabOrd As String = "A5 B22 C5 A11 D10 F7"
On Error Resume Next
Range(Trim(Split(Split(aTabOrd & " " & aTabOrd, Target.Address(0, 0) _
& " ", , vbTextCompare)(1))(0))).Select
End Sub

....

Close. Make the C5 address in aTabOrder AC5 instead, then enter
something in C5. FUBAR!

Make the .Select method call

Range(Trim(Split(Split(" " & aTabOrd & " " & aTabOrd, _
" " & Target.Address(0, 0) & " ", , vbTextCompare)(1))(0))).Select

Delimiters are a pain.

 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 07:10 PM.


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