Need help, Please.

zucatbfw

New Member
Joined
Aug 24, 2011
Messages
1
<style>@font-face { font-family: "Cambria"; }p.MsoNormal, li.MsoNormal, div.MsoNormal { margin: 0in 0in 10pt; font-size: 12pt; font-family: "Times New Roman"; }div.Section1 { page: Section1; }</style> This is my problem...with the data.

User Name | User Id | Date | ID Number | Number of Pays
John Miller | 001231 | 02/23/2009 | 222565555 | 1
Mary Smith | 015482 | 01/25/2009 | 222356987 | 5
Joe Black | 125897 | 08/26/2010 | 336598875 | 4
John Doe | 003594 | 05/58/2008 | 458972213 | 0

I have 6 tabs (Jan, Feb, Mar, ect.) and I only want the | User Name | John Miller to appear if he shows up in all 6 months. The challenge is the names range from 9000 to 11000 in the various months, you can see why I simply can't look for him in each month manually.

Do you think you can help?
 

Excel Facts

Lock one reference in a formula
Need 1 part of a formula to always point to the same range? use $ signs: $V$2:$Z$99 will always point to V2:Z99, even after copying
your entry of names etc are having some unnecessary spaces so I have to trim all the cells and that is why sub trimming

you have not told if John Miller occurs in all the six sheets then what to do with his name. I have colored his name in the first sheet

sheets are named jan, feb, mar, apr, may and jun


try these macros

Code:
Dim j As Integer, nname As String, cfind As Range, m As Integer
Sub trimming()
Dim cell As Range
For m = 1 To Worksheets.Count
With Worksheets(m)
For Each cell In .UsedRange
cell = Trim(cell)
Next cell
End With
Next m
End Sub



Code:
Sub test()

j = 0
nname = "John Miller"
For m = 1 To Worksheets.Count
With Worksheets(m)
Set cfind = .Cells.Find(what:=nname, lookat:=xlWhole)
If Not cfind Is Nothing Then
j = j + 1
Else
GoTo eend
End If
End With

Next m
If j = 6 Then
With Worksheets("jan")
Set cfind = .Cells.Find(what:=nname, lookat:=xlWhole)
cfind.Interior.ColorIndex = 3
End With
End If
eend:
End Sub
 
Upvote 0

Forum statistics

Threads
1,224,566
Messages
6,179,555
Members
452,928
Latest member
101blockchains

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