View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.misc
Don Guillett Don Guillett is offline
external usenet poster
 
Posts: 10,124
Default Code using A sheet to find a number

What you have now is looking for one instance of the value in cell b3. This
would be much easier with a select case statement. My question is:
Are you looking for all three of these? And, are there more than one
instance? Maybe you want.

Sub findem()
myarray = Array("a", "b", "c")
For Each c In myarray
x = Columns(4).Find(c)
Select Case UCase(x)
Case "A": y = 1
Case "B": y = 2
Case "C": y = 3
Case Else
End Select
MsgBox y
Next
End Sub


--
Don Guillett
SalesAid Software

"Mike" wrote in message
...
Can someone help please
I would like for it to look at sheet2 and see if "V014989" Is in the
column
A Row 2:65535



Private Sub StoreAccountNumbers()
On Error Resume Next
With ActiveSheet
If .Range("B3").Value = "V014989" Then
.Name = "101_" & Format(Now(), "[$-409]yyyymmdd;@")

ElseIf .Range("B3").Value = "V014990" Then
.Name = "102_" & Format(Now(), "[$-409]yyyymmdd;@")
End If
End With
With ActiveSheet
If .Range("B3").Value = "V014991" Then
.Name = "103_" & Format(Now(), "[$-409]yyyymmdd;@")
ElseIf .Range("B3").Value "V014991" Then
.Name = "Unknown_" & Format(Now(), "[$-409]yyyymmdd;@")
End If
If Err.Number < 0 Then
MsgBox Err.Number & " -- " & Err.Description
End If
On Error GoTo 0
End With
'PromptForSave
'SaveWorkbookToFolder
End Sub