Wrox Programmer Forums
|
Excel VBA Discuss using VBA for Excel programming.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Excel VBA section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old February 13th, 2007, 04:47 PM
Registered User
 
Join Date: Feb 2007
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default re-occurring text

I have a XL spread sheet which i have created at work its very simple I only use it to input data for work which receive.

What I need help with is when I enter a address in on a line I want the spread sheet to alert me if i type the same address in again later in the spread sheet.

Help with this would be very much appreciated.

Tony

 
Old February 14th, 2007, 12:17 AM
Friend of Wrox
 
Join Date: Sep 2005
Posts: 812
Thanks: 1
Thanked 53 Times in 49 Posts
Default

You can use the selection change even to check the user entry and ignore the text if already found


Private Sub Worksheet_SelectionChange(ByVal Target As Range)

 ' Loop thru the entire contents to check for address
 For i = 1 To Cells.SpecialCells(xlCellTypeLastCell).Row
    ' your code
    If addressfound Then
        MsgBox "Address exist!!!"
        ActiveCell.Value = vbNullString
    End If
 Next i

End Sub

Cheers
Shasur

http://www.vbadud.blogspot.com





Similar Threads
Thread Thread Starter Forum Replies Last Post
Convert Text(Sql Server Text Field) to Image(JPG) srinivas72 ADO.NET 2 February 13th, 2009 06:31 PM
re-occurring text newbie2007 Excel VBA 0 February 13th, 2007 04:47 PM
re- occurring text newbie2007 Need help with your homework? 0 February 13th, 2007 04:40 PM
Text Box .text Property Displays conflicting Valus JPOhlman Visual Basic 2005 Basics 3 August 23rd, 2006 02:39 PM
Extract text from text file & put in dropdown box tsukey Beginning PHP 5 July 20th, 2004 09:49 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.