Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 51
Default Help with VBA, or maybe vanilla Excel function?

I want to tabulate a From-To places list
to signify trips FromA-ToB.

Say I have col A validated against a list that
signifies the "From". Col B is also validated
with the same list, that signifies the "To".
Obviously, I don't want Col A and Col B
be the same value for the same row since
FromA-ToA does not make sense.

How can I do this in VBA, or vanilla Excel?

--
- Zilla
(Remove XSPAM)


  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 4,339
Default Help with VBA, or maybe vanilla Excel function?

Right Click tab on worksheet where your data is entered, "view code" and
copy/paste this code. Assumes entries are in Columns A & B.

HTH


Private Sub Worksheet_Change(ByVal Target As Range)
On Error GoTo ws_exit
Application.EnableEvents = False
If Target.Column < 3 Then
If Cells(Target.Row, "A") = Cells(Target.Row, "B") Then
MsgBox "To/From cannot be same location"
End If
End If
ws_exit:
Application.EnableEvents = True
End Sub

"Zilla" wrote:

I want to tabulate a From-To places list
to signify trips FromA-ToB.

Say I have col A validated against a list that
signifies the "From". Col B is also validated
with the same list, that signifies the "To".
Obviously, I don't want Col A and Col B
be the same value for the same row since
FromA-ToA does not make sense.

How can I do this in VBA, or vanilla Excel?

--
- Zilla
(Remove XSPAM)



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
challenge! javascript function into excel function Kamila Excel Worksheet Functions 2 February 19th 07 06:35 AM
FUNCTION GETPIVOTDATA MICROSOFT EXCEL 2003 VS EXCEL 2004 FOR MAC FRANCISCO PEREZ-LANDAETA Excel Worksheet Functions 0 July 6th 06 01:25 PM
Excel Workday Function with another function Monique Excel Discussion (Misc queries) 2 April 27th 06 01:11 PM
Can you nest a MID function within a IF function in Excel Dawn-Anne Excel Worksheet Functions 2 March 4th 05 01:37 PM
Statistical Excel Function Question within Excel 2000... Drew H Excel Worksheet Functions 3 October 31st 04 06:55 PM


All times are GMT +1. The time now is 11:30 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"