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: 1
Default macro to process rows in a selection

I am trying to create an action item list manager. The list
itself is simple but now I want a macro to derive some
statistics, for example the number of action items that are
open per person.

Given my current list, the process is as follows:
a) filter on status to get all the open items (manual)
b) select the rows I am interested in (manual)
c) run a macro that goes through the rows checking and counting
the actionees (which are kept in a column). The macro reports
in a different worksheet.

Using the web and the help function, I have come up with the
follwing. All seems to work except for the test in line 13. I
cannot get that right. I guess it has something to do with the
data type of the .value method. I mostly get a data type mismatch
error.

Note that the actionee field can contain more than one person,
so I cannot use a direct test (which didn't work either).

Does someone have advise for me on how to get this working?
Does someone have a recommendation of a text book which deals
with this kind of macro programming?


1 Dim row As Integer
2 Dim r1 As Range
3
4
5 Dim count_fdb As Integer
6
7 Set r1 = Selection
8
9 Sheets("AI Summary").Select
10 Range("A1").Select
11
12 For row = 1 To r1.Rows.Count
13 If Filter(r1.Offset(row - 1, 2).Value, "FDB") Then
14 count_fdb = count_fdb + 1
15 End If
16 Next row
17 Cells(1, 1).Value = count_fdb

--
-- Frank
 
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
the process of displaying a subset of rows in a table means? unknowlegeable Excel Discussion (Misc queries) 2 March 15th 09 06:56 PM
How can run a macro ( call a macro) on selection of any filtercriteria? [email protected] Excel Worksheet Functions 7 February 20th 09 12:34 AM
Macro to automate process Journey Excel Discussion (Misc queries) 0 June 13th 08 02:53 PM
Selection of Rows Alan Excel Programming 2 June 30th 04 05:32 PM
Run a macro batch process marijo[_8_] Excel Programming 2 June 2nd 04 02:46 AM


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