Home |
Search |
Today's Posts |
#10
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Sorry, replace:
.Cells(2, 4) = .Cells(2, 4) + _ Application.SumIf(xFilter, "*SAFEWAY*", xSum) with .Cells(2, 4) = .Cells(2, 4) - _ Application.SumIf(xFilter, "*SAFEWAY*", xSum) "Charabeuh" a écrit dans le message de groupe de discussion : ... Another code (shorter): '''''''''''''''''''''''''''''''''''''''''''''''''' '' Sub Macro2() Dim xFilter As Range, xSum As Range With ActiveSheet Set xFilter = .Range("A1:A1000") Set xSum = xFilter.Offset(0, 1) .Cells(2, 4) = .Cells(2, 4) + _ Application.SumIf(xFilter, "*SAFEWAY*", xSum) End With End Sub '''''''''''''''''''''''''''''''''''''''''''''''''' '' "Ali" a écrit dans le message de groupe de discussion : ... I want to select a cell that contain a specific word in it: I have written as follow: Sub Test() Cells(2, 4) = 0 For i = 1 To 1000 If Cells(i, 1).Contain "SAFEWAY" Then Cells(2, 4) = Cells(2, 4) - Cells(i, 2) End If Next i End Sub But it does't work could you please make it correct for me. Thanks Ali |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
How can change range to select active rows instead of :=Range("S10 | Excel Discussion (Misc queries) | |||
macro to select range from active cell range name string | Excel Programming | |||
When entering data into a range of cells, select the entire range. | Excel Discussion (Misc queries) | |||
Compare a selected Range with a Named range and select cells that do not exist | Excel Programming | |||
Select Sheet then Select Range | Excel Programming |