Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 55
Default Excel, Marking a field when text is not like required

Hello,

I like to have a module which marks the datafield, in column A from
record 2 till last, in color red when the registered data is not equal
to "aaa" or "bbb" or "ccc".
Can you help me out.

Johan
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,501
Default Excel, Marking a field when text is not like required

Hi,

Right click your sheet tab, view code and paste this in and run it

Sub Sonic()
Dim R As Range
Dim V As Variant
Dim S As String
lastrow = Cells(Cells.Rows.Count, "A").End(xlUp).Row
S = "aaa,bbb,ccc"
V = Split(S, ",")
For Each R In Range("A1:A" & lastrow)
If IsError(Application.Match(CStr(R.Value), V, 0)) Then
R.Interior.ColorIndex = 3
End If
Next R
End Sub

Mike

" wrote:

Hello,

I like to have a module which marks the datafield, in column A from
record 2 till last, in color red when the registered data is not equal
to "aaa" or "bbb" or "ccc".
Can you help me out.

Johan

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,298
Default Excel, Marking a field when text is not like required

you could use Conditional Format on A2.A999

use 'formula is' and

=NOT(OR(A8="aaa",A8="bbb",A8="ccc"))
set a pattern color as required

Patrick Molloy

" wrote:

Hello,

I like to have a module which marks the datafield, in column A from
record 2 till last, in color red when the registered data is not equal
to "aaa" or "bbb" or "ccc".
Can you help me out.

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
Linked excel field from access form field - help required. fishy Excel Programming 1 April 5th 08 02:43 PM
can I make a field in excel spreadsheet required? If yes, How? Ginycub22 Excel Discussion (Misc queries) 0 August 23rd 06 08:30 PM
In Excel, how to make a field required so it's not left blank? linplex Excel Programming 1 June 5th 06 03:10 PM
Required field message - Excel Steve S via OfficeKB.com Excel Discussion (Misc queries) 2 May 9th 05 04:16 PM
Field Required if another field is checked ** Kelly ******** Excel Programming 1 August 20th 03 10:44 PM


All times are GMT +1. The time now is 06:18 AM.

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"