Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 59
Default compare string to column

I have a form that has a log number (i.e. E29029) that gets approved and and
the first character gets removed and the new number replaces the one in the
actual data log (i.e. E29029 becomes 29029). How would I go about verifying
that there is not a duplicate in the data log prior to changing the cell
(i.e. if EOTemp = cells (X,y) or EONo = cells(x,y) then msgbox"Duplication
error, press ok to open the log for editing"
else
cells(x,y) = EONo.

Thanks in advance
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default compare string to column

Dim res1, res2, res3
res1 = application.Match(EOTemp,Columns(2),0)
res2 = application.Match(cStr(EONo),Columns(2),0)
res3 = application.Match(clng(EONo),Columns(2),0)
if not iserror(res1) or not iserror(res2) or not iserror(res3) then
msgbox"Duplication error, press ok to open the log for editing"
Else
cells(rows.count,2).End(xlup)(2).Value = EONo
End if

--
Regards,
Tom Ogilvy


"asmenut" wrote in message
...
I have a form that has a log number (i.e. E29029) that gets approved and

and
the first character gets removed and the new number replaces the one in

the
actual data log (i.e. E29029 becomes 29029). How would I go about

verifying
that there is not a duplicate in the data log prior to changing the cell
(i.e. if EOTemp = cells (X,y) or EONo = cells(x,y) then msgbox"Duplication
error, press ok to open the log for editing"
else
cells(x,y) = EONo.

Thanks in advance



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 59
Default compare string to column

Thanks Tom. You da man

"Tom Ogilvy" wrote:

Dim res1, res2, res3
res1 = application.Match(EOTemp,Columns(2),0)
res2 = application.Match(cStr(EONo),Columns(2),0)
res3 = application.Match(clng(EONo),Columns(2),0)
if not iserror(res1) or not iserror(res2) or not iserror(res3) then
msgbox"Duplication error, press ok to open the log for editing"
Else
cells(rows.count,2).End(xlup)(2).Value = EONo
End if

--
Regards,
Tom Ogilvy


"asmenut" wrote in message
...
I have a form that has a log number (i.e. E29029) that gets approved and

and
the first character gets removed and the new number replaces the one in

the
actual data log (i.e. E29029 becomes 29029). How would I go about

verifying
that there is not a duplicate in the data log prior to changing the cell
(i.e. if EOTemp = cells (X,y) or EONo = cells(x,y) then msgbox"Duplication
error, press ok to open the log for editing"
else
cells(x,y) = EONo.

Thanks in advance




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
compare string HugeHard Excel Worksheet Functions 1 October 30th 08 04:59 AM
Compare text string of a cell in Column A VS another cell in Colum Tan New Users to Excel 2 August 1st 07 09:45 AM
Compare text string of a cell in Column A VS another cell in Colum Tan Excel Discussion (Misc queries) 1 August 1st 07 09:03 AM
Compare text string of a cell in Column A VS another cell in Colum Tan Excel Worksheet Functions 1 August 1st 07 09:01 AM
How do I compare string values in one column to another column? Nick N. Excel Worksheet Functions 1 April 29th 06 02:56 AM


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