LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 70
Default CPSCount

Here is the code I currently have.

Sub CPSCount()

Columns("B:C").Select
Selection.Copy
Sheets.Add
Sheets("Sheet3").Select
Sheets("Sheet3").Name = "Sheet3"
Range("A1").Select
ActiveSheet.Paste
Rows("1:1").Select
Application.CutCopyMode = False
Selection.Insert Shift:=xlDown
Range("C1").Select
ActiveCell.FormulaR1C1 = "MP11"
Range("D1").Select
ActiveCell.FormulaR1C1 = "MP12"
Range("E1").Select
ActiveCell.FormulaR1C1 = "MP20"

This is what my code currently does€¦

Sheet 1 copy columns B:C

Insert new worksheet (Sheet3)

Paste contents into new worksheet (Sheet3) starting in cell A1

Insert row above Row 1

In cell C1 type MP11, in cell D1 type MP12, and in cell E1 type MP20

These are the additional steps I would like my code to take€¦

Every cell in Column B has either MP11, MP12, or MP20, while every cell in
Column A has a 7 digit number, so the contents of Column A and Column B
belong together.

I want to keep a tally/count of how many times each seven digit number
appears in MP11, MP12, and MP20. In other words, I want to create a code
that will look at the number in Column A then look for MP11, MP12, or MP20 in
Column B. If Column B says MP11 then increase Column C by 1 in the same row,
if Column B says MP12 then increase Column D by 1 in the same row, if Column
B says MP20 then increase Column E by 1 in the same row. Sometimes the seven
digit number in Column A will be repeated. When that happens I want to
delete the row where the duplicate(s) appear(s) but increase the count in
Column C, D, or E (depending on the contents in Column B) by 1.

 
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
CPSCount MCheru Excel Worksheet Functions 2 March 24th 09 02:18 AM


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