Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi hibatt,
A few things (which doesn't necessarily make an error) - you haven't declared c, Dim c as Range - working with row numbers, it is better to use Long variable instead of Integer because there are 64K+ row an Integer could come short. - look at the Value or Text properties of a cell to see what's in there. - use the InStr() function to search a substring with a string. - no need to select a cell to write into it. Sub Copy() Dim c as Range Dim Store As Integer Store = 0 For Each c In Worksheets("SPARE9").Range("O11:O92").Cells If InStr(1,c.Text,"x", vbTextCompare) 0 Then Store = Store +1 Next Range("A1").Value= Store End Sub Regards, Sebastien |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Excell copy action pauses for 15 second for the smallest action | Excel Discussion (Misc queries) | |||
2007: xlsm format holds how many columns? | Excel Discussion (Misc queries) | |||
How to make Same formula over multiple rows but still holds row # | Excel Worksheet Functions | |||
how can I customise a toolbar with a tag that holds macros | Charts and Charting in Excel | |||
How do I create a footnote for a cell that holds a SUM function . | Excel Discussion (Misc queries) |