Good. Glad to help. > Date: Wed, 6 May 2009 05:22:51 -0700 > Subject: $$Excel-Macros$$ Re: VBA code to search a column for a string > From: dsrmccl...@gmail.com > To: excel-macros@googlegroups.com > > > Dave, > Thanks. With a little bit of tweaking that's just what I needed! > > Doug > > On May 5, 10:12 pm, Dave Bonallack <davebonall...@hotmail.com> wrote: > > Hi, try this code somewhere in your sub: > > > > With Range(A1:A1000) > > > > D = "Seed-BOD" > > Set C = .Find(D, LookIn:=xlFormulas) > > If Not C Is Nothing Then MsgBox "Sample is already here." > > End With > > > > If you are already using C and/or D as variables, you'll need to change > > them. > > > > You may need to change the range in the first line. > > > > Regards - Dave. > > > > > > > > > > > > > Date: Tue, 5 May 2009 05:03:49 -0700 > > > Subject: $$Excel-Macros$$ VBA code to search a column for a string > > > From: dsrmccl...@gmail.com > > > To: excel-macros@googlegroups.com > > > > > Seems easy enough but I'm new at VBA so I can't seem to get it right. > > > > > I have a sub that adds a row to my worksheet but this particular row > > > needs to be unique. So all I want to do is call a function that will > > > search the first column of the active worksheet for the string "Seed- > > > BOD". If it finds the string, it gives a message "Sample is already > > > here." If it doesn't find the string then the sub will continue. > > > > > I don't want it to go to where the string is. I just want to confirm > > > whether it exists or not. > > > > > Thanks. > > > > _________________________________________________________________ > > Looking for a fresh way to share your photos? Check out the new Windows > > Live Messengerhttp://windowslive.ninemsn.com.au/article.aspx?id=792335- > > Hide quoted text - > > > > - Show quoted text - > > >
_________________________________________________________________ View photos of singles in your area Click Here http://a.ninemsn.com.au/b.aspx?URL=http%3A%2F%2Fdating%2Eninemsn%2Ecom%2Eau%2Fsearch%2Fsearch%2Easpx%3Fexec%3Dgo%26tp%3Dq%26gc%3D2%26tr%3D1%26lage%3D18%26uage%3D55%26cl%3D14%26sl%3D0%26dist%3D50%26po%3D1%26do%3D2%26trackingid%3D1046138%26r2s%3D1&_t=773166090&_r=Hotmail_Endtext&_m=EXT --~--~---------~--~----~------------~-------~--~----~ ------------------------------------------------------------------------------------- Some important links for excel users: 1. Excel and VBA Tutorials(Video and Text), Free add-ins downloads at http://www.excelitems.com 2. Excel tutorials at http://www.excel-macros.blogspot.com 3. Learn VBA Macros at http://www.vbamacros.blogspot.com 4. Excel Tips and Tricks at http://exceldailytip.blogspot.com To post to this group, send email to excel-macros@googlegroups.com If you find any spam message in the group, please send an email to: Ayush Jain @ jainayus...@gmail.com or Ashish Jain @ 26may.1...@gmail.com ------------------------------------------------------------------------------------- -~----------~----~----~----~------~----~------~--~---