VBA- finding alpha numeric numbers in another sheet

Warhammer

New Member
Joined
Oct 25, 2012
Messages
8
I have a macro that searches for numbers in another sheet and then copies the row it finds it in to sheet 1.
the problem is that some of the search criteria is alpha numeric. i.e 227A, JD190T, etc.

code
Sub copyit()

Dim wsSearch As Worksheet, wsResult As Worksheet
Dim Found As Range, rngWhat As Range

Set wsSearch = Sheets("Compiler")
Set wsResult = Sheets("Sheet1")
Set rngWhat = wsResult.Range("A1")

If Not IsEmpty(rngWhat) Then
Set Found = wsSearch.Range("A:A").Find(What:=rngWhat.Value, _
LookIn:=xlValues, _
LookAt:=xlWhole, _
SearchOrder:=xlByRows, _
SearchDirection:=xlNext, _
MatchCase:=False)

If Not Found Is Nothing Then
Found.EntireRow.Copy Destination:=wsResult.Range("A5")
Else
MsgBox "No match found for " & rngWhat.Value, , "No Match"
End If
End If

End Sub
code

i have the searchable row in sheet "compiler" set to General formatting.
i'm also having the same problem using Vlookup for the same thing in a list.
=VLOOKUP(A10,Compiler!$A$1:$AP$6359,5,FALSE)
it finds the numeric value's but returns N/A for anything with a letter in it.
i've been searching and tryign different things for a few days with no luck.
Thanks!
 

Excel Facts

Is there a shortcut key for strikethrough?
Ctrl+S is used for Save. Ctrl+5 is used for Strikethrough. Why Ctrl+5? When you use hashmarks to count |||| is 4, strike through to mean 5.

Forum statistics

Threads
1,223,248
Messages
6,171,021
Members
452,374
Latest member
keccles

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top