LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #10   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 62
Default Select Range

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
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
How can change range to select active rows instead of :=Range("S10 ldiaz Excel Discussion (Misc queries) 7 August 29th 08 03:52 PM
macro to select range from active cell range name string aelbob Excel Programming 2 July 14th 08 09:19 PM
When entering data into a range of cells, select the entire range. Q Excel Discussion (Misc queries) 0 September 26th 07 04:36 AM
Compare a selected Range with a Named range and select cells that do not exist PCLIVE Excel Programming 1 October 18th 05 07:09 PM
Select Sheet then Select Range Gee[_2_] Excel Programming 3 May 27th 04 10:10 PM


All times are GMT +1. The time now is 08:26 AM.

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"