PDA

View Full Version : Find Function Fail on Three-Four Letter Words



Designer6
02-07-2008, 10:12 AM
Hi All,

This is Ridicules. The find function in vba fail to find three or four letter words like "CEO", "EATS", "CFO" ect. It gives me an error "Method 'Range' of object '_Global' failed. Run-Time Error 1004". But it works fine on five letter words or more like "Buddy". As long the caption is 5 letter words and above it works. Below is my code could anyone give me some hints or suggestions on how to solve this problem.


If CheckBox1.Value = True Then
If Not Sheets(Sheet).Cells.Find(CheckBox1.Caption) Is Nothing Then Range(CheckBox1.Caption).EntireColumn.Hidden = False



End If

rory
02-07-2008, 10:41 AM
That works fine for me. What version of Excel and do you definitely have ranges named "CEO" etc. on the activesheet?

Designer6
02-07-2008, 11:07 AM
That works fine for me. What version of Excel and do you definitely have ranges named "CEO" etc. on the activesheet?


I have Excel 2003