Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
Zen Zen is offline
external usenet poster
 
Posts: 16
Default Macro - highlight rows

Hi everybody,

I have a chunk of records stored in excel and are tracked by account number.
Some of the account numbers are duplicated and I wish to run a macro which
can loop through the records and highlight the row s which have duplicated
account numbers. How do i do it? Thanks in advance
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10,593
Default Macro - highlight rows

You don't need a macro, conditional formatting will do it.

Select all the rows.
Menu FormatConditional Formatting
Change Condition 1 to Formula Is
Add a formula of =COUNTIF($A:$A,A1)1
Click Format, select the Pattern tab, and choose a colour
OK out

This assumes the account is in column A, and you start at row 1.

--
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)

"Zen" wrote in message
...
Hi everybody,

I have a chunk of records stored in excel and are tracked by account
number.
Some of the account numbers are duplicated and I wish to run a macro which
can loop through the records and highlight the row s which have duplicated
account numbers. How do i do it? Thanks in advance



  #3   Report Post  
Posted to microsoft.public.excel.programming
Zen Zen is offline
external usenet poster
 
Posts: 16
Default Macro - highlight rows

It does not work. It highlighted wrong records which are not duplicated

"Bob Phillips" wrote:

You don't need a macro, conditional formatting will do it.

Select all the rows.
Menu FormatConditional Formatting
Change Condition 1 to Formula Is
Add a formula of =COUNTIF($A:$A,A1)1
Click Format, select the Pattern tab, and choose a colour
OK out

This assumes the account is in column A, and you start at row 1.

--
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)

"Zen" wrote in message
...
Hi everybody,

I have a chunk of records stored in excel and are tracked by account
number.
Some of the account numbers are duplicated and I wish to run a macro which
can loop through the records and highlight the row s which have duplicated
account numbers. How do i do it? Thanks in advance




  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10,593
Default Macro - highlight rows

Works for me, although it is better if the formula is

=COUNTIF($A:$A,$A1)1


--
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)

"Zen" wrote in message
...
It does not work. It highlighted wrong records which are not duplicated

"Bob Phillips" wrote:

You don't need a macro, conditional formatting will do it.

Select all the rows.
Menu FormatConditional Formatting
Change Condition 1 to Formula Is
Add a formula of =COUNTIF($A:$A,A1)1
Click Format, select the Pattern tab, and choose a colour
OK out

This assumes the account is in column A, and you start at row 1.

--
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my
addy)

"Zen" wrote in message
...
Hi everybody,

I have a chunk of records stored in excel and are tracked by account
number.
Some of the account numbers are duplicated and I wish to run a macro
which
can loop through the records and highlight the row s which have
duplicated
account numbers. How do i do it? Thanks in advance






  #5   Report Post  
Posted to microsoft.public.excel.programming
Zen Zen is offline
external usenet poster
 
Posts: 16
Default Macro - highlight rows

Hi Bob, it works! It works!. Thanks for the assistance. :)

"Bob Phillips" wrote:

Works for me, although it is better if the formula is

=COUNTIF($A:$A,$A1)1


--
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)

"Zen" wrote in message
...
It does not work. It highlighted wrong records which are not duplicated

"Bob Phillips" wrote:

You don't need a macro, conditional formatting will do it.

Select all the rows.
Menu FormatConditional Formatting
Change Condition 1 to Formula Is
Add a formula of =COUNTIF($A:$A,A1)1
Click Format, select the Pattern tab, and choose a colour
OK out

This assumes the account is in column A, and you start at row 1.

--
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my
addy)

"Zen" wrote in message
...
Hi everybody,

I have a chunk of records stored in excel and are tracked by account
number.
Some of the account numbers are duplicated and I wish to run a macro
which
can loop through the records and highlight the row s which have
duplicated
account numbers. How do i do it? Thanks in advance






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
more rows highlight than I want ren Excel Discussion (Misc queries) 1 March 14th 10 10:02 AM
Highlight rows Scott R Excel Worksheet Functions 5 December 5th 07 01:19 AM
Small Macro Revision - to highlight rows and enter how many times they appear in a cell rather than a msg box. [email protected][_2_] Excel Programming 11 June 7th 07 09:43 AM
Macro to highlight rows and... Dave Birley Excel Programming 1 May 1st 07 01:38 PM
Highlight rows Randy Reese Excel Programming 4 March 4th 04 09:36 PM


All times are GMT +1. The time now is 04:10 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"