I have a shapefile containing streets that have to be counted. But these streets in each case consist of several polylines. Maybe I should buffer these polylines and union the generated polygons that have the same name as well as they overlap. Is there a tool or do I have to write a VBA script or something?
You don't need to worry about buffers or Polygons.
I think the tool you are looking for is called "Dissolve" in the Data Management/Generalization Toolbox. You have to decide whether to use the parameter DISSOLVE_LINE or UNSPLIT_LINES - the latter will only create a single line for contiguous features - i.e. lines that share an endpoint.
Dissolve and its usage, in Arcpy, is thus:
It effectively aggregates your geographies on specified attributes i.e. in your case, it's name.
I should add that it is very simple to use, either as a standalone script, or as a command in the python window in 10.
EDIT: You might want to have a look at the answer here if you're prepared to use another software package. From what you've told us it looks like arc may not be the best tool to work with your particular dataset.
i might be misunderstanding what you need. but if all you need is a count of unique street names, you could maybe use vanilla SQL GROUP BY to aggregate by street name.
select s.street_name, count(*) from streets s group by s.street_name;
of course you'll need a tool that can do SQL against a shapefile/dbf, or put the shapefile/dbf into a DBMS that can do SQL.
Or maybe try Excel - it probably has a function to give you a list of unique values from a column, and a function to count them. You could operate on the shapefile's DBF directly in Excel.