Hello,
Here is the code I am using to search for data in column "B" and the pasting all the row results into sheet2.
It works fine in that if I type in the search box "ASM", it finds everything with "ASM" in the text string, but I want it to also find "asm" at the same time, if it exists or ASM, aSM, asM or Asm ect... ect...
Thanks
Sub Enterdata2()
Dim strLastRow As String
Dim rngC As Range
Dim strToFind As String, FirstAddress As String
Dim wSht As Worksheet
Dim rngtest As String
Application.ScreenUpdating = False
Set wSht = Worksheets("Sheet2")
Excel.Application.Worksheets(1).Select ' alex's contribution to this macro (and the rest)
strToFind = InputBox("Enter the data required to find, n")
With ActiveSheet.Range("B1:B23331")
Set rngC = .Find(what:=strToFind, LookAt:=xlPart)
If Not rngC Is Nothing Then
FirstAddress = rngC.Address
Do
strLastRow = Worksheets("Sheet2").Range("A" & Rows.Count).End(xlUp).Row + 1
rngC.EntireRow.Copy wSht.Cells(strLastRow, 1)
Set rngC = .FindNext(rngC)
Loop While Not rngC Is Nothing And rngC.Address <> FirstAddress
End If
End With
MsgBox ("Finished")
End Sub
Here is the code I am using to search for data in column "B" and the pasting all the row results into sheet2.
It works fine in that if I type in the search box "ASM", it finds everything with "ASM" in the text string, but I want it to also find "asm" at the same time, if it exists or ASM, aSM, asM or Asm ect... ect...
Thanks
Sub Enterdata2()
Dim strLastRow As String
Dim rngC As Range
Dim strToFind As String, FirstAddress As String
Dim wSht As Worksheet
Dim rngtest As String
Application.ScreenUpdating = False
Set wSht = Worksheets("Sheet2")
Excel.Application.Worksheets(1).Select ' alex's contribution to this macro (and the rest)
strToFind = InputBox("Enter the data required to find, n")
With ActiveSheet.Range("B1:B23331")
Set rngC = .Find(what:=strToFind, LookAt:=xlPart)
If Not rngC Is Nothing Then
FirstAddress = rngC.Address
Do
strLastRow = Worksheets("Sheet2").Range("A" & Rows.Count).End(xlUp).Row + 1
rngC.EntireRow.Copy wSht.Cells(strLastRow, 1)
Set rngC = .FindNext(rngC)
Loop While Not rngC Is Nothing And rngC.Address <> FirstAddress
End If
End With
MsgBox ("Finished")
End Sub