Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Junior Member
 
Posts: 1
Default Searching for Data of a certain criteria

Hi all,

brand new member of the site with a bit of a puzzler. Not sure where to start or indeed if this is the place to ask!!

In a nutshell I have a spreadsheet of data that i need to go through to find data that meets a specific criteria and I am not sure where to start.

Best example i can give is a telephone number.
Rather than search the spreadsheet for a specific number i want to be able to get Excel to show me all instances of an eleven digit number regardless of what the actual number is.

Hopefully that makes sense?

Cheers

D.
  #2   Report Post  
Senior Member
 
Location: Hyderabad
Posts: 237
Thumbs up

Quote:
Originally Posted by jinga View Post
Hi all,

brand new member of the site with a bit of a puzzler. Not sure where to start or indeed if this is the place to ask!!

In a nutshell I have a spreadsheet of data that i need to go through to find data that meets a specific criteria and I am not sure where to start.

Best example i can give is a telephone number.
Rather than search the spreadsheet for a specific number i want to be able to get Excel to show me all instances of an eleven digit number regardless of what the actual number is.

Hopefully that makes sense?

Cheers

D.
play with this vba code. changes all the mobile number contained cells background to red color

__________________________________________________ ___________

' created and edited by Bala Sesharao
Sub find_mobile()
Dim x_cordinate, y_cordinate As Variant
Dim resultant As String

x_cordinate = 1
y_cordinate = 1
Sheets("sheet1").Cells(1, 1).Select
For x_cordinate = 1 To 65000
For y_cordinate = 1 To 256
resultant = Sheets("sheet1").Cells(x_cordinate, y_cordinate)
If Len(resultant) = 11 And IsNumeric(resultant) Then
Sheets("sheet1").Cells(x_cordinate, y_cordinate).Select
With Selection.Interior
.Pattern = xlSolid
.PatternColorIndex = xlAutomatic
.Color = 255
.TintAndShade = 0
.PatternTintAndShade = 0
End With
End If
Next y_cordinate
Next x_cordinate



End Sub

Private Sub Workbook_Open()
Call find_mobile
End Sub

____________________________________
__________________
Thanks
Bala
  #3   Report Post  
Senior Member
 
Location: Hyderabad
Posts: 237
Thumbs up

Quote:
Originally Posted by bala_vb View Post
play with this vba code. changes all the mobile number contained cells background to red color

__________________________________________________ ___________

' created and edited by Bala Sesharao
Sub find_mobile()
Dim x_cordinate, y_cordinate As Variant
Dim resultant As String

x_cordinate = 1
y_cordinate = 1
Sheets("sheet1").Cells(1, 1).Select
For x_cordinate = 1 To 65000
For y_cordinate = 1 To 256
resultant = Sheets("sheet1").Cells(x_cordinate, y_cordinate)
If Len(resultant) = 11 And IsNumeric(resultant) Then
Sheets("sheet1").Cells(x_cordinate, y_cordinate).Select
With Selection.Interior
.Pattern = xlSolid
.PatternColorIndex = xlAutomatic
.Color = 255
.TintAndShade = 0
.PatternTintAndShade = 0
End With
End If
Next y_cordinate
Next x_cordinate



End Sub

Private Sub Workbook_Open()
Call find_mobile
End Sub

____________________________________
the logic in the above code
1) find the numeric cells in the sheet1 (change the sheet name as required)
2) evaluate all the numeric cells with length = 11 character i.e mobile number
__________________
Thanks
Bala
  #4   Report Post  
Senior Member
 
Location: Philippines
Posts: 161
Default

Quote:
Originally Posted by jinga View Post
Hi all,

brand new member of the site with a bit of a puzzler. Not sure where to start or indeed if this is the place to ask!!

In a nutshell I have a spreadsheet of data that i need to go through to find data that meets a specific criteria and I am not sure where to start.

Best example i can give is a telephone number.
Rather than search the spreadsheet for a specific number i want to be able to get Excel to show me all instances of an eleven digit number regardless of what the actual number is.

Hopefully that makes sense?

Cheers

D.
If column A is where are all the numbers a

=IF(LEN(A2)=11,"Mobile Number","Not Mobile Number")
Reply
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
Searching data in multiple rows using search criteria bletch23 Excel Worksheet Functions 2 March 4th 10 03:11 AM
Formula for searching 3 criteria Craig Excel Discussion (Misc queries) 4 February 18th 09 01:22 PM
Formula for searching 3 different Criteria Craig Excel Discussion (Misc queries) 1 February 9th 09 04:34 PM
Searching two columns against a specific criteria Colin Excel Worksheet Functions 2 July 10th 07 07:20 PM
Formula searching data that dose not equal two criteria FarmerGemGem Excel Discussion (Misc queries) 4 March 20th 07 10:04 AM


All times are GMT +1. The time now is 10:13 PM.

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"