Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Counting names thru code
How does one count the number of times Tommy is present in
Column A (starting at A7) of Sheet 1 when I am in Sheet4? I tried using: With Worksheets("Sheets1 Selection.FormulaR1C1 = "=COUNTIF(Sheet1!RC[7]:end (xlDown),""Tommy"")" but it did not work. Anyone know how to correct my confused code above? |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Counting names thru code
Try this
Private Sub CommandButton1_Click() For x = 7 To 1000 If Range("A" & x) = "Tommy" Then y = y + 1 Next x Range("B1") = y End Sub "Tom Jameson" wrote in message ... How does one count the number of times Tommy is present in Column A (starting at A7) of Sheet 1 when I am in Sheet4? I tried using: With Worksheets("Sheets1 Selection.FormulaR1C1 = "=COUNTIF(Sheet1!RC[7]:end (xlDown),""Tommy"")" but it did not work. Anyone know how to correct my confused code above? |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Counting names thru code
or
Selection.FormulaR1C1 = "=COUNTIF(Sheet1!R7C1:R" & _ Worksheets("Sheet1").Cells(7, "A").End(xlDown).Row & _ "C1,""Tommy"")" -- HTH Bob Phillips ... looking out across Poole Harbour to the Purbecks (remove nothere from the email address if mailing direct) "Mike Tomasura" wrote in message ... Try this Private Sub CommandButton1_Click() For x = 7 To 1000 If Range("A" & x) = "Tommy" Then y = y + 1 Next x Range("B1") = y End Sub "Tom Jameson" wrote in message ... How does one count the number of times Tommy is present in Column A (starting at A7) of Sheet 1 when I am in Sheet4? I tried using: With Worksheets("Sheets1 Selection.FormulaR1C1 = "=COUNTIF(Sheet1!RC[7]:end (xlDown),""Tommy"")" but it did not work. Anyone know how to correct my confused code above? |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
using the Excel generic worksheet names instead of user-given names in code | Excel Discussion (Misc queries) | |||
counting names | Excel Discussion (Misc queries) | |||
counting of names | Excel Discussion (Misc queries) | |||
counting names | Excel Worksheet Functions | |||
Counting names in a column but counting duplicate names once | Excel Discussion (Misc queries) |