Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
condionally formatting based on another cells formatting? | Excel Discussion (Misc queries) | |||
conditionally formatting cells based on other cells | Excel Discussion (Misc queries) | |||
Formatting cells in a column with conditional formatting? | Excel Discussion (Misc queries) | |||
Help formatting cells | Excel Worksheet Functions | |||
Conditional Formatting Multiple cells based on 2 cells | Excel Worksheet Functions |