Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9
Default formatting cells

Hi,

I would appreciate it if you could tell me how to do the VB code for
these:

1) Start at row 1. Go to column 2 and check if it contains the words
"etc". If it does have these words, blank out the cell to make it
empty. If it doesn`t have these words, do nothing. Do this for every
row of the dataset which contains data.

2) Go through a data set and delete all rows which are duplicates. A
duplicate is when a row`s contents in columns 1,2 and 3 are identical to
that in columns 1,2 and 3 of another row.

Thanks.

Dan





*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default formatting cells

1)
Dim rng as Range
set rng = Range(Cells(1,2),Cells(rows.count,2).End(xlup))
for each cell in rng
if instr(1,cell,"etc",vbTextCompare) 0 then
cell.clearcontents
end if
Next

2)
are the rows sorted so that any duplicates would be next to each other?

--
Regards,
Tom Ogilvy

"dan graziano" wrote in message
...
Hi,

I would appreciate it if you could tell me how to do the VB code for
these:

1) Start at row 1. Go to column 2 and check if it contains the words
"etc". If it does have these words, blank out the cell to make it
empty. If it doesn`t have these words, do nothing. Do this for every
row of the dataset which contains data.

2) Go through a data set and delete all rows which are duplicates. A
duplicate is when a row`s contents in columns 1,2 and 3 are identical to
that in columns 1,2 and 3 of another row.

Thanks.

Dan





*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9
Default formatting cells


Hi Tom,

Thanks for the code for the first question.

The positioning of the duplicate rows may be very random, there is no
pattern to their positioning. It`s a very large dataset, and it`s
possible that duplicate rows are not next to each other (ie. they may be
rows 1 and rows 5000). Or it`s also possible that duplicate rows are
next to each other (ie. they may be rows 1 and 2).

Thanks.

Dan

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
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
condionally formatting based on another cells formatting? Derrick Excel Discussion (Misc queries) 2 July 31st 09 08:05 PM
conditionally formatting cells based on other cells Derrick Excel Discussion (Misc queries) 1 July 7th 09 09:43 PM
Formatting cells in a column with conditional formatting? shamor Excel Discussion (Misc queries) 8 May 19th 08 10:11 PM
Help formatting cells Gordon Baxter Excel Worksheet Functions 10 November 13th 05 01:21 PM
Conditional Formatting Multiple cells based on 2 cells Louis Markowski Excel Worksheet Functions 2 June 1st 05 05:26 PM


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