Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 34
Default Marking records with mismatched data

Hello,

I hope somebody can help me out with this questions.

1th question:
In sheet1 there is a list with names in range B10 till B...(last used
record).
In this sheet there is also by a few names in kolom A10 till A...(last
used record) registrated the letter "O".
So we have for example:
A B
record 10 O Pietersen
record 11 Jansen
record 12 O Klaasen
record 13 Huisma

In sheet2 in range A2 till A.. (last used record) are also names
registrated.
I need a macro that coloring red the datafield in sheet2 if this name
is not on the list in sheet1 and if the name is registrated on the
list but there is no letter O registrated before it in kolom A it
should be coloring yellow.

2th question:
In a specific kolom (format "number" with 0 decimals) the user should
registrate a four digit number with the number format. If there is
registrated something differents (more or less numbers or a
dateformat) the datafield should be coloring red.

If somebody can help me........
Thanks a lot.

Regards,
Johan.
The Netherlands.

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 812
Default Marking records with mismatched data

If I understood it correctly, the following answers your 1st question.
Your 2nd question wasn't clear enough for me, but you can probably
answer it yourself using the following as a guide.

Hth,
Merjet


Sub Macro1()
Dim c1 As Range
Dim c2 As Range
Dim rng1 As Range
Dim rng2 As Range
Dim iEnd As Long
Dim bFound As Boolean

iEnd = Sheets("Sheet1").Range("B65536").End(xlUp).Row
Set rng1 = Sheets("Sheet1").Range("B10:B" & iEnd)
iEnd = Sheets("Sheet2").Range("A65536").End(xlUp).Row
Set rng2 = Sheets("Sheet2").Range("A2:A" & iEnd)
For Each c2 In rng2
bFound = False
For Each c1 In rng1
If c1 = c2 Then
bFound = True
If c1.Offset(0, -1) < "O" Then c2.Interior.ColorIndex = 6
End If
Next c1
If bFound = False Then c2.Interior.ColorIndex = 3
Next c2

End Sub



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 34
Default Marking records with mismatched data

On May 12, 3:06 pm, merjet wrote:
If I understood it correctly, the following answers your 1st question.
Your 2nd question wasn't clear enough for me, but you can probably
answer it yourself using the following as a guide.

Hth,
Merjet


-------------------------------

THANKS Merjet,
It's the solution for both questions.

Regards,
Johan

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
Marking data sets with non-blank cells Elinora Excel Discussion (Misc queries) 0 May 11th 09 07:06 PM
Delete records when certain records have duplicate column data JVroom New Users to Excel 1 January 26th 09 06:23 PM
mismatched data types sonia210c Excel Programming 3 March 27th 07 05:48 AM
Compare List and Show Mismatched Phillycheese5 Excel Worksheet Functions 3 June 22nd 05 05:25 PM
Type mismatched in Listbox Wellie[_2_] Excel Programming 1 February 18th 04 06:39 PM


All times are GMT +1. The time now is 11:18 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"