LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 24
Default VLOOKUP PART 2....(Dave Paterson)

The folowing code was supplied by Dave Paterson....Many
Thanks

I Can only get this code to work when I replace "sheet1"
with the actual sheet tab name ie "BOM Summary file1"
As the "sheet tab name" changes for each job / file why
shouldn't "Sheet1" overide the tab name????

Am I doing something wrong???

Option Explicit
Sub testme01()
Dim FoundCell As Range
Dim FirstAddress As String
Dim FindWhat As String

FindWhat = "109000"

With Worksheets("sheet1").Range("a:a")
Set FoundCell = .Cells.Find(what:=FindWhat, _
after:=.Cells(.Cells.Count), _
LookIn:=xlFormulas, lookat:=xlWhole)

If FoundCell Is Nothing Then
'do nothing
Else

FirstAddress = FoundCell.Address
Do
FoundCell.Offset(0, 1).Value = 0
Set FoundCell = .FindNext(FoundCell)
Loop While Not FoundCell Is Nothing _
And FoundCell.Address < FirstAddress
End If
End With
End Sub


 
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
Vlookup with part match Rob Excel Worksheet Functions 5 December 13th 09 05:07 PM
Dave phlogiston appears in spreadsheet cell when I type Dave P tallsaint Excel Discussion (Misc queries) 2 September 4th 09 11:05 AM
Part of VLOOKUP not working Code Numpty Excel Worksheet Functions 4 December 10th 08 02:05 PM
Question for dave Paterson capt Excel Discussion (Misc queries) 8 February 28th 08 12:20 AM
Vlookup for part of a word jenhow Excel Worksheet Functions 7 April 29th 05 10:22 PM


All times are GMT +1. The time now is 05:14 AM.

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"