josros60

Well-known Member
Joined
Jun 27, 2010
Messages
780
Office Version
  1. 365
Hi,


i have this huge spreasheet (attached) that i want to search for records and put the results temporary an new sheet but i am not good in vba, can any body help.


CARRIERACCOUNT NUMBERACCOUNT NAMEBTNWTNAUTH_CODEAUTH.CODE.STATUS
BCTEL000071411CENTURY 21 MOVING REAL ESTATE BC LTD250378434400000000002503784344Active
BCTEL000000021CN (IT TELECOM)250459791800000000002504597918Active
BCTEL000000021CN (IT TELECOM)250459792800000000002504597928Active
BCTEL000110709GLOBAL PARTNERS INSTITUTE604448425000000000006044484250Active
BCTEL000076963GEORGE RICHARD LOW250577375800000000002505773758Active
BCTEL000110024ROYAL LEPAGE LOCATIONS WEST REALTY250493758700000000002504937587Active
BCTEL000151077VILLAGE OF PORT ALICE250284339200000000002502843392Active
BCTEL000105151ABC ALLEN BUSINESS COMMUNICATIONS250770131700000000002507701317Active
BCTEL000105151ABC ALLEN BUSINESS COMMUNICATIONS250770860100000000002507708601Active
BCTEL000105151ABC ALLEN BUSINESS COMMUNICATIONS250770860200000000002507708602Active
BCTEL000105151ABC ALLEN BUSINESS COMMUNICATIONS250770915700000000002507709157Active
BCTEL000105151ABC ALLEN BUSINESS COMMUNICATIONS250770131700000000002507701317Active
BCTEL000105151ABC ALLEN BUSINESS COMMUNICATIONS250770860100000000002507708601Active
BCTEL000105151ABC ALLEN BUSINESS COMMUNICATIONS250770860200000000002507708602Active
BCTEL000105151ABC ALLEN BUSINESS COMMUNICATIONS250770915700000000002507709157Active
BCTEL000074693HOMELIFE GLENAYRE REALTY CO LTD604462735900000000006044627359Active
BCTEL000163771IKTEROS ENTERPRISES INC604448879000000000006044488790Active
TELUS000164717BANCORP FINANCIAL SERVICES INC604608271700000000006046082717Active
TELUS000158736ESKIMO STEEL403468091000000000004034680910Active
TELUS000158775ASA ALLOYS INC EDMONTON403417054200000000004034170542Active
TELUS000158736ESKIMO STEEL403468090900000000004034680909Active
TELUS000158736ESKIMO STEEL403468173600000000004034681736Active
TELUS000158775ASA ALLOYS INC EDMONTON403417051300000000004034170513Active
TELUS000158775ASA ALLOYS INC EDMONTON403417051400000000004034170514Active
TELUS000158775ASA ALLOYS INC EDMONTON403417051500000000004034170515Active
TELUS000158775ASA ALLOYS INC EDMONTON403417051600000000004034170516Active
TELUS000158775ASA ALLOYS INC EDMONTON403417051700000000004034170517Active
TELUS000158775ASA ALLOYS INC EDMONTON403417056400000000004034170564Active
TELUS000158736ESKIMO STEEL403463970400000000004034639704Active
BCTEL000171397STERLING GROUP CORP604850129900000000006048501299Active
BCTEL000061435CONSULATE GENERAL OF JAPAN604685589500000000006046855895Active
BCTEL000095108TIDE RIP TOURS LTD.250928309200000000002509283092Active

<tbody>
</tbody>

<tbody>
</tbody>



thank you
 
The auth code is in table and somebody give a code I want to be able to list only that number with their related tisc_code from the list.

I tried to build a pivot table but I could not figured out.

Thank you
 
Upvote 0

Excel Facts

Get help while writing formula
Click the italics "fx" icon to the left of the formula bar to open the Functions Arguments dialog. Help is displayed for each argument.
Is this what you're after?
Code:
Sub CopyFltr()

   Dim Auth As String
   
   Auth = InputBox("Please enter an AuthCode")
   If Len(Auth) = 0 Then
      MsgBox "Nothing entered"
      Exit Sub
   End If
   
   With ActiveSheet
      If .AutoFilterMode Then .AutoFilterMode = False
      .Range("A1:J1").AutoFilter 8, Auth
      .Range("A1").CurrentRegion.SpecialCells(xlVisible).Copy Sheets("[COLOR=#ff0000]Temp[/COLOR]").Range("A1")
      .Range("A1").AutoFilter
   End With

End Sub
Change the sheet name in red to suit
 
Upvote 0
Is this what you're after?
Code:
Sub CopyFltr()

   Dim Auth As String
   
   Auth = InputBox("Please enter an AuthCode")
   If Len(Auth) = 0 Then
      MsgBox "Nothing entered"
      Exit Sub
   End If
   
   With ActiveSheet
      If .AutoFilterMode Then .AutoFilterMode = False
      .Range("A1:J1").AutoFilter 8, Auth
      .Range("A1").CurrentRegion.SpecialCells(xlVisible).Copy Sheets("[COLOR=#ff0000]Temp[/COLOR]").Range("A1")
      .Range("A1").AutoFilter
   End With

End Sub
Change the sheet name in red to suit

What he said ?
 
Upvote 0
thank you so much works, perfectly.

if is not too much to bother you, is there any to add if want to search for another cell not just auth_code and when transfer to "Temp" sheet can it give the records found count.

if can do it only, if not thanks for all your help.
 
Upvote 0
What would be the other column & search value?
Also, do you want to copy only those rows that match both values, or those rows that match either?
 
Upvote 0
yes, the other will be account number, yes both values that match.

thank you,
 
Upvote 0
Try this
Code:
Sub CopyFltr()

   Dim Auth As String
   Dim Acc As String
   
   Auth = InputBox("Please enter an AuthCode")
   If Len(Auth) = 0 Then
      MsgBox "Nothing entered"
      Exit Sub
   End If
   Acc = InputBox("Please enter an Account")
   If Len(Acc) = 0 Then
      MsgBox "Nothing entered"
      Exit Sub
   End If

   With ActiveSheet
      If .AutoFilterMode Then .AutoFilterMode = False
      .Range("A1:J1").AutoFilter 8, Auth
      .Range("A1:J1").AutoFilter 4, Acc
      .Range("A1").CurrentRegion.SpecialCells(xlVisible).Copy Sheets("Temp").Range("A1")
      .Range("A1").AutoFilter
   End With

End Sub
 
Upvote 0
Sorry. Misposted. :)
 
Last edited:
Upvote 0

Forum statistics

Threads
1,215,061
Messages
6,122,921
Members
449,094
Latest member
teemeren

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