<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-21667255</id><updated>2011-04-21T12:32:21.340-07:00</updated><category term='Sim City'/><category term='SImCity4'/><title type='text'>My Basic journal</title><subtitle type='html'>A few posts on SimCity4

plus notes to self about OOo Basic (which I've obviously just started to learn)</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://basic1605.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/21667255/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://basic1605.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Carol</name><uri>http://www.blogger.com/profile/18378658078131278144</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>25</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-21667255.post-8068160583645855743</id><published>2008-10-06T09:24:00.000-07:00</published><updated>2008-10-06T10:05:04.621-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Sim City'/><category scheme='http://www.blogger.com/atom/ns#' term='SImCity4'/><title type='text'>Sim City 4 - Cities</title><content type='html'>&lt;div style="text-align: center;"&gt;&lt;span style="font-weight: bold;"&gt;Farm communities&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;The first city in a region often starts out as a farm community. But, as education levels increase, demand for farmland decreases.  To keep the city a farm community, start zoning as low density residential and low density commercial. Because of the low density, there is no need to go beyond windmills and water towers. The more educated citizens will commute to other cities for better employment possibilities.&lt;br /&gt;&lt;div style="text-align: center;"&gt;&lt;span style="font-weight: bold;"&gt;Bedroom communities&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;A bedroom community provides employees for the other cities in the region. It's probably the hardest one to make money on. Sims need a lot of services to be happy. To keep the traffic down, you will need transportation. At a minimum, you will need bus stops.  Though, I like to do without bus service and just concentrate on trains and subways.  As the city and region grow, you will also need passenger train service to industrial cities and subway service to commercial cities. A few commercial areas within the city will help keep the Sims happy -- and help generate money.&lt;br /&gt;&lt;div style="text-align: center;"&gt;&lt;span style="font-weight: bold;"&gt;Purely industrial or commercial cities&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;These are the easiest to make money with because they don't need services such as hospitals and schools. In fact, these cities don't even need a police department since there are no Sims living there to commit crimes.  The cities don't even need a fire department.  When a fire start, you can plunk down a firehouse near the flames and then demolish it when the flames are out.  (You don't even need a road for the fire engine to travel along.)&lt;br /&gt;&lt;div style="text-align: center;"&gt;&lt;span style="font-weight: bold;"&gt;Mega cities&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;To get all or most of the rewards possible in the game, you need a city with residential, commercial, and industrial areas. When planning to develop a mega city, I start with farms and high (or medium) density residential and commercial areas.  (Tall buildings won't develop without water, and so I don't see much need to start with low density zoning.)  I place the first residential/commercial area in a corner of the city.  Then I establish a train link to what will become an industrial city.&lt;br /&gt;The industrial city can provide electricity (a coal-burning plant), garbage disposal (a waste-to-energy plant set at zero electricity production), and jobs for lower skilled workers.  The residential city can provide water for the industrial city when it is time to water the city.  (Dirty industry and farms produce water pollution which stops water pumps from working.)&lt;br /&gt;As the city grows, you will get some beneficial rewards such as the mayor's house, a farmer's market, the state fair, houses of worship, private schools, and cemeteries. Then as the city grows and the citizenry become more educated, you'll want to dezone farmland and build more residential and commercial areas. When the demand meter shows that the only type of industry wanted is high tech, it's time to start building non-farm industrial areas.&lt;br /&gt;I like to start off by building along the edges of the city map with farmland in the center of the map.  When the farmland is dezoned, it provides a perfect place for a city center.&lt;br /&gt;Hold off on a lot of the rewards. I would suggest waiting before building such rewards as the country club, city hall, university, and tourist trap -- either because of the monthly cost or the need for nearby police. (It seems that the larger an area a reward takes up, the more need it has for police.)&lt;br /&gt;Also, hold off on establishing a purely commercial city bordering the mega city until your commercial areas are well developed.&lt;br /&gt;When you do start watering the city and zoning for high density development, it will be time to demolish small police stations and build large ones where they can have the best coverage. You'll probably also want to move the library and museum. (I'd suggest near a college -- for ease in keeping track of them.) You'll need the central space for larger schools for your growing population.&lt;br /&gt;&lt;div style="text-align: center;"&gt;&lt;span style="font-weight: bold;"&gt;Some notes about transportation: &lt;/span&gt;&lt;br /&gt;&lt;/div&gt;I'm ambivalent about bus stops.  Sometimes I think they cause more traffic congestion than they alleviate.  For smaller cities, if you decide to use buses, place bus stops along heavily traveled routes to relieve congestion. For larger cities, place bus stops (or, better, subway stops) near residential skyscrapers and also work places. To get a new residential section to develop, place a bus stop near the residential zones.   (People will hop off the bus and decide to build a house.)&lt;br /&gt;I think that passenger train stations and the like do more than bus stops do to alleviate congestion.  Passenger train stations also provide taxi service.&lt;br /&gt;When choosing an airport to build, choose one that is right for the size of your city. If it's too large, it will drain your finances. If it's too small, it won't develop properly.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/21667255-8068160583645855743?l=basic1605.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://basic1605.blogspot.com/feeds/8068160583645855743/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=21667255&amp;postID=8068160583645855743' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/21667255/posts/default/8068160583645855743'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/21667255/posts/default/8068160583645855743'/><link rel='alternate' type='text/html' href='http://basic1605.blogspot.com/2008/10/sim-city-4-cities.html' title='Sim City 4 - Cities'/><author><name>Carol</name><uri>http://www.blogger.com/profile/18378658078131278144</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-21667255.post-4115203504132347426</id><published>2008-10-04T07:45:00.000-07:00</published><updated>2008-10-04T09:16:04.881-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Sim City'/><category scheme='http://www.blogger.com/atom/ns#' term='SImCity4'/><title type='text'>Sim City 4 - Zones</title><content type='html'>&lt;div style="text-align: center;"&gt;&lt;span style="font-weight: bold;"&gt;Residential&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;ul&gt;&lt;li&gt;Residential areas need schools (elementary and high school) plus health care (large medical center). The best place to put them is in the center of each residential area. When the city is still small, it's also a good idea to put a library, museum, fire department, and police department in the center as well. This allows you to find and check them easily.  But, of course, don't add all of these services at the start.  (I usually just start out a residential neighborhood with an elementary school, museum and library -- set to the minimum levels.  The museum will provide buses for the school -- even if the school is set to minimum coverage area.)&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_igWUh8QIZS4/SOeD7aJAtvI/AAAAAAAAAqg/x1Gf8uKyvcc/s1600-h/RArea.GIF"&gt;&lt;img style="margin: 0pt 0pt 10px 10px; float: right; cursor: pointer;" src="http://3.bp.blogspot.com/_igWUh8QIZS4/SOeD7aJAtvI/AAAAAAAAAqg/x1Gf8uKyvcc/s320/RArea.GIF" alt="" id="BLOGGER_PHOTO_ID_5253312547003610866" border="0" /&gt;&lt;/a&gt;&lt;/li&gt;&lt;li&gt;This diagram shows how a completed residential area might look. The light green areas are areas that could be zoned for residential development, if watered, but left open or as parks if not. It also shows how services can be placed in one location.&lt;/li&gt;&lt;li&gt;Residential areas also need a lot of open areas. 1x6 open areas can be used to divide traffic flow and also to provide space for possible bus stops, subway stops, or parks/recreational areas. Larger open areas are great for a college, softball field, large police station (when needed), and house of worship.&lt;/li&gt;&lt;li&gt;Do not put residential zones next to the edge of the map. Sims do not like to live near traffic. It causes noise and air pollution. And there will be a lot of traffic going from one zone to another using the shortest possible route. The first money-making city I made had residential zones next to the edge of the map. I got so frustrated at their poor development that first I tried to torch them (which didn't work because of the smoke detector ordinance) and then I tried a meteor shower.&lt;/li&gt;&lt;/ul&gt;&lt;div style="text-align: center; font-weight: bold;"&gt;Commercial&lt;br /&gt;&lt;/div&gt;&lt;ul&gt;&lt;li&gt;Commercial areas need open spaces as much as residential areas do. Smaller open areas can be used for statues and small plazas. Larger ones can be used for plazas or rewards such as a farmer's market. Even larger ones can be used for larger rewards.&lt;/li&gt;&lt;li&gt;It's better not to put commercial areas right next to residential ones. There should be a buffer between the two. Though, it is nice if there are some within easy walking distance.  There should also be a buffer between certain commercial rewards and residential zones.&lt;/li&gt;&lt;li&gt;I like to put passenger train stations in those commercial areas near residential areas.  It helps increase traffic to stores near the stations.&lt;br /&gt;&lt;/li&gt;&lt;/ul&gt;&lt;div style="text-align: center;"&gt;&lt;span style="font-weight: bold;"&gt;Farm&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;ul&gt;&lt;li&gt;Farms are important when a city is just starting out.   They employ a lot of minimally educated people.  Plus they provide one of the nicer rewards, in my opinion, the farmer's market.&lt;/li&gt;&lt;li&gt;They should be positioned away from commercial and residential areas. Commercial areas do not like being next to farms. Residential areas will develop well adjacent to farms but will soon complain about water pollution. Farms can be placed on slopes.&lt;/li&gt;&lt;li&gt;It's not clear to me whether large or medium or small farms are better.  Although farmland is cheap to dezone, farm buildings are less so. However, larger farms seem to produce more water pollution.  &lt;/li&gt;&lt;li&gt;It's possible to create a giant-sized farm with no interior roads by pausing the game during its creation.  Zone for farmland to just before a road would appear.  Then zone more farmland next to the original zone, etc.  Unpause when the farm is large enough.  (There is an upper limit on how large a farm can be made and still develop.)   However, I recommend the "trick" detailed for low-tech industry such as farms.&lt;br /&gt;&lt;/li&gt;&lt;li&gt;For a large city, you'll want to dezone farmland until there are no farms left. For a small town, you'll probably want to keep the farms.&lt;/li&gt;&lt;li&gt;For the original version of the game, a town size of 3000 and farm population of 120 will give you a farmer's market, and a town size of 3500 and farm population of 240 will give you a state fair. (These numbers are different from the numbers supplied by the game. They are based on experience.  However, for the deluxe version, the numbers are as supplied by the game.) Both the farmer's market and state fair should be placed with commercial zones. The farmer's market can be placed next to a residential zone, but the state fair should be quite a few squares away from any residential zones. (One web page said at least 17 squares away.)&lt;/li&gt;&lt;/ul&gt;&lt;div style="text-align: center;"&gt;&lt;span style="font-weight: bold;"&gt;Non-Farm Industrial&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;ul&gt;&lt;li&gt;In general, these areas should be in their own separate city.  Dirty industry produces a lot of air and water pollution. The pollution produced is so high that tech will only locate at the edges of these industrial areas. Farms also will not get settled when pollution is high. Trees and parks will help with pollution to a small extent.&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_igWUh8QIZS4/SOeQN96fvQI/AAAAAAAAAqo/3fjGhgHp8AA/s1600-h/industry.GIF"&gt;&lt;img style="margin: 0pt 0pt 10px 10px; float: right; cursor: pointer;" src="http://4.bp.blogspot.com/_igWUh8QIZS4/SOeQN96fvQI/AAAAAAAAAqo/3fjGhgHp8AA/s320/industry.GIF" alt="" id="BLOGGER_PHOTO_ID_5253326059983584514" border="0" /&gt;&lt;/a&gt;&lt;/li&gt;&lt;li&gt;It's also a good idea to build train tracks through industrial zones and connected to neighboring cities.  Freight trains will appear even without freight stations.&lt;/li&gt;&lt;li&gt;For my first few cities I  built bus stops when traffic became a problem.  However, I like the "trick" I read about at &lt;a href="http://www.simtropolis.com/"&gt;simtropolis.com&lt;/a&gt; for zoning industry.  Build a train track through the area you want to zone.  Add a 3-square-long road that crosses the railroad tracks - as in the diagram at the right.  If the area is zoned for farms, 4 farmhouses will develop on the road.  If the area is zoned for other industry, a factory will develop at a corner next to the road.  Then the rest of the zoned area will develop the same type of industry.  There is no need to build passenger train stations at the crossing.  Evidently, people just jump off the train as it slows for the road crossing.  ;)&lt;br /&gt;&lt;/li&gt;&lt;li&gt;High-tech industry can be placed in a regular city. When a residential city is well educated, the demand meter for that city and possibly neighboring cities will show demand for only high tech industry. Add industrial zones to a residential city gradually in the same types of places you would commercial zones. Be sure to add open areas and flower gardens.&lt;/li&gt;&lt;/ul&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/21667255-4115203504132347426?l=basic1605.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://basic1605.blogspot.com/feeds/4115203504132347426/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=21667255&amp;postID=4115203504132347426' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/21667255/posts/default/4115203504132347426'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/21667255/posts/default/4115203504132347426'/><link rel='alternate' type='text/html' href='http://basic1605.blogspot.com/2008/10/sim-city-4-zones.html' title='Sim City 4 - Zones'/><author><name>Carol</name><uri>http://www.blogger.com/profile/18378658078131278144</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://3.bp.blogspot.com/_igWUh8QIZS4/SOeD7aJAtvI/AAAAAAAAAqg/x1Gf8uKyvcc/s72-c/RArea.GIF' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-21667255.post-6611956753303116776</id><published>2008-10-01T08:59:00.000-07:00</published><updated>2008-10-01T10:06:36.803-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Sim City'/><category scheme='http://www.blogger.com/atom/ns#' term='SImCity4'/><title type='text'>Sim City 4 - Walk through</title><content type='html'>&lt;div style="text-align: center;"&gt;&lt;span style="font-weight: bold;"&gt;Basics&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;In SimCity 4, it is possible to create a city that starts making money starting at the end of the second month. There are a few tricks to this.&lt;br /&gt;&lt;ul&gt;&lt;li&gt;&lt;span style="font-weight: bold;"&gt;Legalize gambling.&lt;/span&gt; It gives you an extra §100 per month. &lt;/li&gt;&lt;li&gt;&lt;span style="font-weight: bold;"&gt;Don’t build too many streets/roads during the first few months&lt;/span&gt;. Their upkeep can make a difference between a loss and a profit for the city during these months. &lt;/li&gt;&lt;li&gt;&lt;span style="font-weight: bold;"&gt;Start with a windmill instead of a big power plant.&lt;/span&gt; Windmills provide electricity at a lower cost than a natural gas power plant – up to the power provided by 4 windmills. &lt;/li&gt;&lt;li&gt;&lt;span style="font-weight: bold;"&gt;Don’t add services until needed.&lt;/span&gt; Starting with a library and museum is fine. Together they cost less than §10 per month. Add an elementary school when you can afford the cost. Then add a high school, large medical center, and a water tower or two, in that order, as you can afford them. With the Smoke Detector Program, you can wait until there is a fire before building a small fire station – and still put out the fire. I usually end up adding a college before a fire department. Add a small police department or two when you have the money. Police and fire departments help attract business. &lt;/li&gt;&lt;li&gt;&lt;span style="font-weight: bold;"&gt;Don’t be afraid of farmland.&lt;/span&gt; Farms are good employers for startup cities. &lt;/li&gt;&lt;li&gt;&lt;span style="font-weight: bold;"&gt;Utilize neighbor cities.&lt;/span&gt; When Sims complain about garbage, build a connecting city, an industrial city, with a waste to energy plant. Set the energy production for the plant to zero, but accept garbage from the first city. Set the garbage import rate to maximum. When you return to the original city, set the garbage export rate to about half of the maximum. Later, have your original city export water to the industrial one. &lt;/li&gt;&lt;li&gt;&lt;span style="font-weight: bold;"&gt;Do urban renewal&lt;/span&gt;. Dezone farmland that is no longer needed. Demolish buildings (like used car dealerships) that create a nuisance. Change or add streets to help traffic flow. Demolish buildings that have passed their prime, that no longer have any Sims in them -- provided you have the money to do so. &lt;/li&gt;&lt;li&gt;&lt;span style="font-weight: bold;"&gt;Micromanage.&lt;/span&gt; Set the coverage area low for schools and medical centers but not fire or police departments. Check often whether you have enough desks (schools), beds (medical centers), books (libraries), tickets (museums), and cells (police departments). As a side note, if teachers or health care workers go on strike, it's cheaper to bulldoze the building and replace it with another than to pay the increased costs to end the strike. &lt;/li&gt;&lt;/ul&gt;--------------------------------------------------------------------------------&lt;br /&gt;&lt;br /&gt;&lt;div style="text-align: center;"&gt;&lt;span style="font-weight: bold;"&gt;The First Three Months&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;ul&gt;&lt;li&gt;&lt;span style="font-weight: bold;"&gt;Month 1:&lt;/span&gt;   Pause. While in God Mode, use a smoothing or feathering tool to smooth out the terrain. If you want to add a beach or dock to your future city, be sure to smooth the beach area so that there are sections of beach that are aligned with the grid. Add forests. Go to Mayor Mode to start the city and give it a name.&lt;/li&gt;&lt;/ul&gt;&lt;ul&gt;&lt;li&gt;Keep the game paused. Lay out a minimal residential area. (For a first city, zone for moderate residential and commercial areas.) Add one windmill set at §50, a few streets, and small commercial areas at one or more corners. Leave an empty area at the center of the development for future services (such as education, health care, and safety). Add a farm set away from the town and connected to the town by a road or two and a power line. Lay out connections to two neighboring cities. Unpause.&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_igWUh8QIZS4/SOOf_3SWs_I/AAAAAAAAAqQ/GQgXo94bagM/s1600-h/StartUp.GIF"&gt;&lt;img style="margin: 0pt 0pt 10px 10px; float: right; cursor: pointer;" src="http://3.bp.blogspot.com/_igWUh8QIZS4/SOOf_3SWs_I/AAAAAAAAAqQ/GQgXo94bagM/s320/StartUp.GIF" alt="" id="BLOGGER_PHOTO_ID_5252217509965640690" border="0" /&gt;&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;&lt;ul&gt;&lt;li&gt;&lt;span style="font-weight: bold;"&gt;Month 2:&lt;/span&gt;  Pause. Open the city ordinances box and choose to legalize gambling. Also, choose the Smoke Detector Program and Clean Air Act. Unpause.&lt;/li&gt;&lt;/ul&gt;&lt;ul&gt;&lt;li&gt;&lt;span style="font-weight: bold;"&gt;Month 3:&lt;/span&gt;  Add more streets, residential areas, and/or farmland as needed. Add a library and museum. Set their funding low (less than §10 between the two).&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;At the right is a sample town plan:&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;--------------------------------------------------------------------------------&lt;br /&gt;&lt;br /&gt;&lt;div style="text-align: center;"&gt;&lt;span style="font-weight: bold;"&gt;Utilities&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;span style="font-weight: bold;"&gt;Electricity&lt;/span&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Start &lt;span style="font-weight: bold;"&gt;residential and commercial cities&lt;/span&gt; with 1 windmill. Add more windmills as the population grows. However, instead of adding a fifth windmill, build a natural gas power plant in a corner of the city and decrease the funding for the windmills to zero. There is no need to demolish them. (Note: Windmills produce no pollution. Natural gas power plants produce minimal water pollution.)&lt;/li&gt;&lt;li&gt;Start &lt;span style="font-weight: bold;"&gt;industrial cities&lt;/span&gt; with 2 windmills at full power plus a waste to energy plant at zero power. When demand increases, build a coal plant in a corner of the city and decrease the funding for the windmills to zero. (Note: Coal plants produce a lot of air and water pollution, but they produce a lot of electricity at a cheap rate. It's best to keep them away from everything -- except the corner of the map.)&lt;/li&gt;&lt;/ul&gt;&lt;span style="font-weight: bold;"&gt;Water&lt;/span&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Water is the main reason for choosing a system of streets or empty land every 7th square both lengthwise and crosswise. Pipes provide water for buildings up to 6 squares away. An optimal way of laying pipes would be to have one crosswise pipe (under a road or empty land) and then lengthwise pipes every 14th square. (The roads with no pipes under them would be unwatered.)&lt;/li&gt;&lt;li&gt;&lt;span style="font-style: italic;"&gt;Startup cities do not need water or water pipes&lt;/span&gt;. They just won't develop beyond the light development stage. Once you do add water, be prepared for a burst of activity. Whether it is better to start with water towers or water pumps depends on the size of the city at the time they are added. It's best to keep water funding near maximum to keep pipes from bursting.&lt;/li&gt;&lt;li&gt;&lt;span style="font-style: italic;"&gt;Four water towers at full capacity provide water for a lower cost than one water pump at the equivalent partial capacity.&lt;/span&gt; Note also that all water resources need to be run at the same capacity. So, water towers should be demolished before building the first water pump. Just as power plants need to be periodically replaced as they age, so do water towers and water pumps.&lt;/li&gt;&lt;li&gt;Finally, &lt;span style="font-style: italic;"&gt;industrial cities and cities in which you decide to keep farmland will eventually need a water treatment plant.&lt;/span&gt; Commercial areas and high-tech areas do not like water pollution. Plus, water pumps and towers will stop working if water pollution near them becomes too high.&lt;/li&gt;&lt;/ul&gt;&lt;span style="font-weight: bold;"&gt;Garbage &lt;/span&gt;&lt;ul&gt;&lt;li&gt;&lt;span style="font-style: italic;"&gt;Garbage is best taken care of by a waste to energy plant (set at zero electricity production) in a completely industrial city.&lt;/span&gt; Since there is nobody living in the city, there is no one to complain about the pollution. However, for the health of the industry in the city, locate the plant a short distance away from the main industrial areas.&lt;/li&gt;&lt;li&gt;For large residential cities, recycling centers are nice but not essential -- as long as garbage is taken care of in some way.&lt;br /&gt;&lt;/li&gt;&lt;li&gt;If for some reason you like vultures (I think that's what they are), create a landfill.&lt;/li&gt;&lt;/ul&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/21667255-6611956753303116776?l=basic1605.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://basic1605.blogspot.com/feeds/6611956753303116776/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=21667255&amp;postID=6611956753303116776' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/21667255/posts/default/6611956753303116776'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/21667255/posts/default/6611956753303116776'/><link rel='alternate' type='text/html' href='http://basic1605.blogspot.com/2008/10/sim-city-4-walk-through.html' title='Sim City 4 - Walk through'/><author><name>Carol</name><uri>http://www.blogger.com/profile/18378658078131278144</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://3.bp.blogspot.com/_igWUh8QIZS4/SOOf_3SWs_I/AAAAAAAAAqQ/GQgXo94bagM/s72-c/StartUp.GIF' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-21667255.post-6531939327530718131</id><published>2008-10-01T08:49:00.000-07:00</published><updated>2008-10-06T10:04:51.349-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Sim City'/><category scheme='http://www.blogger.com/atom/ns#' term='SImCity4'/><title type='text'>Sim City 4</title><content type='html'>Since aol Journals and Home Spaces are shutting down, I'm moving some pages I created about Sim City 4 over to here.&lt;br /&gt;&lt;br /&gt;The first page of these pages  has hints on starting a city, including a &lt;a href="http://basic1605.blogspot.com/2008/10/sim-city-4-walk-through.html"&gt;walk through for the first 3 months&lt;/a&gt;  plus some thoughts about utilities.  The next page has info on &lt;a href="http://basic1605.blogspot.com/2008/10/sim-city-4-zones.html"&gt;zones&lt;/a&gt;.  The final page has info on &lt;a href="http://basic1605.blogspot.com/2008/10/sim-city-4-cities.html"&gt;types of cities&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Links&lt;/span&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;The Region part of the official strategy guide at &lt;a href="http://simcity.ea.com/tipstricks/tipsntricks.php"&gt;EA Games&lt;/a&gt; allowed me to create my first money-making city. The city fell apart after it reached 20,000, but I didn't need to take out any loans.&lt;/li&gt;&lt;li&gt;&lt;a href="http://www.gamespot.com/pc/strategy/simcity4/hints.html"&gt;Gamespot&lt;/a&gt; has a lot of useful hints.   Scroll down the page.&lt;/li&gt;&lt;li&gt;&lt;a href="http://www.simtropolis.com/"&gt;Simtropolis.com&lt;/a&gt; has many more hints plus a link to a very active Sim City bulletin board.&lt;/li&gt;&lt;/ul&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/21667255-6531939327530718131?l=basic1605.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://basic1605.blogspot.com/feeds/6531939327530718131/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=21667255&amp;postID=6531939327530718131' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/21667255/posts/default/6531939327530718131'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/21667255/posts/default/6531939327530718131'/><link rel='alternate' type='text/html' href='http://basic1605.blogspot.com/2008/10/sim-city-4.html' title='Sim City 4'/><author><name>Carol</name><uri>http://www.blogger.com/profile/18378658078131278144</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-21667255.post-2896249636900885550</id><published>2008-02-18T09:02:00.000-08:00</published><updated>2008-02-18T09:24:21.855-08:00</updated><title type='text'>printing</title><content type='html'>Here is the basics of a print macro that will print successive pages in turn.  Use the "end of used area"-Cursor to print just the used area (bounded by blank rows and columns).  Use the "gotoend"-Cursor to print the entire sheet (all the cells with entries plus, of course, the blank rows and columns).  It prints the range from oCell (here, the top left cell on the page) to the lower right edge of oCursor.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="color: rgb(0, 102, 0);"&gt;Sub printpage&lt;br /&gt;oSheets = ThisComponent.sheets&lt;br /&gt;&lt;br /&gt;for j = 0 to oSheets.count() - 1&lt;br /&gt;oSheet = oSheets.getbyindex(j)&lt;br /&gt; oCell = oSheet.getcellbyposition(0,0)   &lt;br /&gt; oCursor = oSheet.createCursorbyrange(oCell)&lt;br /&gt; oCursor.gotoEndOfUsedArea(true)   '&lt;span style="font-style:italic;"&gt; This is a range&lt;/span&gt;&lt;br /&gt; oCursor.gotoEnd   '&lt;span style="font-style:italic;"&gt;This is a single cell&lt;/span&gt;&lt;br /&gt; ThisComponent.getCurrentController.select(oCursor)&lt;br /&gt;&lt;br /&gt; answer = msgbox("Do you want to print this sheet?",3,"Print sheet?")&lt;br /&gt; if answer = 3 then'cancel&lt;br /&gt;   exit sub&lt;br /&gt; elseif answer = 6 then'yes&lt;br /&gt;oPrintArea(0).StartColumn = oCell.rangeaddress.StartColumn&lt;br /&gt;oPrintArea(0).EndColumn = oCell.rangeaddress.EndColumn&lt;br /&gt;oPrintArea(0).StartRow = oCursor.rangeaddress.StartRow&lt;br /&gt;oPrintArea(0).EndRow = oCursor.rangeaddress.EndRow&lt;br /&gt;oSheet.setPrintAreas(oPrintArea())&lt;br /&gt;thisComponent.Print(Array())&lt;br /&gt;end if&lt;br /&gt;&lt;br /&gt;next&lt;br /&gt;end sub&lt;/span&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/21667255-2896249636900885550?l=basic1605.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://basic1605.blogspot.com/feeds/2896249636900885550/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=21667255&amp;postID=2896249636900885550' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/21667255/posts/default/2896249636900885550'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/21667255/posts/default/2896249636900885550'/><link rel='alternate' type='text/html' href='http://basic1605.blogspot.com/2008/02/printing.html' title='printing'/><author><name>Carol</name><uri>http://www.blogger.com/profile/18378658078131278144</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-21667255.post-2722163300766053922</id><published>2007-09-14T11:38:00.000-07:00</published><updated>2007-09-14T11:43:31.321-07:00</updated><title type='text'>where macros and dialogs are kept</title><content type='html'>I just discovered that my version wasn't keeping my macros where I thought.  After looking and looking (Search didn't work), I finally looked at Tools/Options/OpenOffice.Org/Paths/Basic.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/21667255-2722163300766053922?l=basic1605.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://basic1605.blogspot.com/feeds/2722163300766053922/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=21667255&amp;postID=2722163300766053922' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/21667255/posts/default/2722163300766053922'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/21667255/posts/default/2722163300766053922'/><link rel='alternate' type='text/html' href='http://basic1605.blogspot.com/2007/09/where-macros-and-dialogs-are-kept.html' title='where macros and dialogs are kept'/><author><name>Carol</name><uri>http://www.blogger.com/profile/18378658078131278144</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-21667255.post-4161316524897957049</id><published>2007-09-11T10:28:00.000-07:00</published><updated>2007-09-11T10:33:12.732-07:00</updated><title type='text'>finally, redid this</title><content type='html'>This took me a long time to recreate.  But, I think it's finally ok.&lt;br /&gt;&lt;span style="font-size:85%;"&gt;Sub Lines(tfield, tname2, tbroker2, tshares2, tbasis2, xshares, xbasis, ten())'----------------Lines----------------&lt;br /&gt;dim clrw(3)&lt;br /&gt;dim tots(9)'running totals&lt;br /&gt;&lt;br /&gt;tshares1 = val(ten(0))'shs added to tname1, may be negative&lt;br /&gt;tbasis1 = val(ten(9))'basis added to tname1, may be negative&lt;br /&gt;if ten(6) = "exchange" or ten(6) = "transfer" then tbasis1 = 0&lt;br /&gt;'for transfer and exchange, tbasis1 and tbasis2 start off at zero&lt;br /&gt;'tbasis1 = - tbasis2 are calculated here&lt;br /&gt;&lt;br /&gt;if val(tshares2) &lt;&gt; 0 then two = -1 else two = 0&lt;br /&gt;&lt;br /&gt;if tfield = "stock" then&lt;br /&gt;   trange = "Trades"&lt;br /&gt;   trange2 = "CTrades"&lt;br /&gt;   tsheet = "Stock"&lt;br /&gt;   diff1 = tshares1 - int(tshares1)&lt;br /&gt;   diff2 = tshares2 - int(tshares2)&lt;br /&gt;   if ten(6) = "exchange" or ten(6) = "merger" then diff1 = 0 : diff2 = 0&lt;br /&gt;elseif tfield = "fund" then&lt;br /&gt;   trange = "Fund"&lt;br /&gt;   trange2 = "CFund"  &lt;br /&gt;   Call NewSheet(tsheet, ten(1), -1, -1)&lt;br /&gt;   oCell = thiscomponent.sheets.getbyname(tsheet).getcellbyposition(0,0)&lt;br /&gt;   thiscomponent.getCurrentController.select(oCell)&lt;br /&gt;   Call Resized(trange, tsheet, "shares", 0, 1, 1)&lt;br /&gt;   Call Resized(trange2, tsheet, "shares", 0, 2, 1)&lt;br /&gt;&lt;br /&gt;   diff1 = 0&lt;br /&gt;   diff2 = 0&lt;br /&gt;else&lt;br /&gt;'    msgbox tfield&lt;br /&gt;   exit sub&lt;br /&gt;end if&lt;br /&gt;&lt;br /&gt;oSheet = SheetObj(trange,tsheet,clrw())&lt;br /&gt;oRange2 = oSheet.getcellrangebyname(trange2)&lt;br /&gt;Call Sorting(trange,tsheet,8,1,2,-1,-1,-1,-1)&lt;br /&gt;&lt;br /&gt;tots(0) = xshares&lt;br /&gt;tots(1) = xbasis&lt;br /&gt;tots(2) = tshares1 + xshares 'new share total&lt;br /&gt;tots(3) = tbasis1 + xbasis 'new basis&lt;br /&gt;tots(4) = diff1&lt;br /&gt;if two then&lt;br /&gt;   tots(5) = tshares2&lt;br /&gt;   tots(6) = tbasis2 ' not needed or used&lt;br /&gt;   tots(7) = diff2&lt;br /&gt;   tots(8) = xbasis ' not needed or used&lt;br /&gt;   tots(9) = xshares&lt;br /&gt;end if&lt;br /&gt;&lt;br /&gt;n = 1&lt;br /&gt;do&lt;br /&gt;   Next1:&lt;br /&gt;   r = ""&lt;br /&gt;   if tots(0) = 0 then exit do&lt;br /&gt;   if (ten(6) = "exchange" or ten(6) = "transfer") and rounding(tots(2) - tots(0),3) = 0 then exit do&lt;br /&gt;&lt;br /&gt;   answer = FindTriple(trange, tsheet, 1, r, ten(1), ten(8), 7, "", 0, n, -1)&lt;br /&gt;   if not answer then exit do&lt;br /&gt;&lt;br /&gt;   if ten(1) = tname2 and ten(8) = tbroker2 then n = n + 1&lt;br /&gt;&lt;br /&gt;   lshares = oSheet.getcellbyposition(0,r).value'shares in entry&lt;br /&gt;   lbasis = oSheet.getcellbyposition(9,r).value'basis in entry&lt;br /&gt;   temp1 = lshares&lt;br /&gt;   temp2 = lbasis&lt;br /&gt;   if lshares = 0 then goto Next1&lt;br /&gt;&lt;br /&gt;   if two then call CopyLine(trange, tsheet, 0, r-clrw(1), trange, tsheet, 0, r + 1-clrw(1), 0)&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;'deal with first line, the line with tname1 and tname2&lt;br /&gt;   if ten(6) = "exchange" or ten(6) = "transfer" then 'may not transfer all shares&lt;br /&gt;       if lshares &gt; abs(tots(2)) then temp1 = lshares - abs(tots(2)) else temp1 = 0&lt;br /&gt;       temp2 = rounding(lbasis * temp1 / lshares, 3)&lt;br /&gt;   else&lt;br /&gt;       temp1 = rounding(lshares * tots(2) / tots(0), 3)&lt;br /&gt;       if tots(1) = 0 then&lt;br /&gt;           temp2 = 0&lt;br /&gt;       else&lt;br /&gt;           temp2 = rounding(lbasis * tots(3) / tots(1), 3)&lt;br /&gt;       end if&lt;br /&gt;   end if&lt;br /&gt;&lt;br /&gt;   todel = 0&lt;br /&gt;   if two then'copy line r to "C" stock/fund&lt;br /&gt;       if rounding(temp1,3) = 0 then todel = -1&lt;br /&gt;       if todel then 'not sure whether first few lines here are needed if line not deleted&lt;br /&gt;           call CopyLine(trange, tsheet, 0, r-clrw(1), trange2, tsheet, 0, 1, todel) 'may delete line&lt;br /&gt;           oSheet.getcellrangebyname(trange2).getcellbyposition(0,1).value = lshares - temp1&lt;br /&gt;           oSheet.getcellrangebyname(trange2).getcellbyposition(9,1).value = lbasis - temp2&lt;br /&gt;           if todel then r = r - 1  &lt;br /&gt;       end if&lt;br /&gt;   end if&lt;br /&gt;&lt;br /&gt;   if not todel then'line r not deleted&lt;br /&gt;           oSheet.getcellbyposition(0,r).value = temp1&lt;br /&gt;           oSheet.getcellbyposition(9,r).value = temp2&lt;br /&gt;           n = n + 1&lt;br /&gt;           if tots(4) &lt;&gt; 0 and temp1 &lt;&gt; 0 then  &lt;br /&gt;           temp3 = rounding(lshares * tots(4) / tots(0), 3)&lt;br /&gt;               call CopyLine(trange, tsheet, 0, r-clrw(1), trange, tsheet, 0, r + 1-clrw(1), 0)&lt;br /&gt;               n = n + 1      &lt;br /&gt;               oSheet.getcellbyposition(0,r+1).value = temp3&lt;br /&gt;               oSheet.getcellbyposition(0,r).value = temp1 - temp3&lt;br /&gt;               oSheet.getcellbyposition(9,r+1).value = rounding(temp2 * temp3 / temp1,2)&lt;br /&gt;               oSheet.getcellbyposition(9,r).value = temp2 - rounding(temp2 * temp3 / temp1,2)&lt;br /&gt;               oSheet.getcellbyposition(6,r).string = ten(6)&lt;br /&gt;               oSheet.getcellbyposition(6,r+1).string = "frac." &amp; ten(6)&lt;br /&gt;               tots(4) = tots(4) - temp3&lt;br /&gt;               r = r + 1&lt;br /&gt;           end if      &lt;br /&gt;   end if      &lt;br /&gt;&lt;br /&gt;       tots(0) = tots(0) - lshares&lt;br /&gt;       tots(1) = tots(1) - lbasis&lt;br /&gt;       tots(2) = tots(2) - temp1 + lshares&lt;br /&gt;       tots(3) = tots(3) - temp2 + lbasis&lt;br /&gt;&lt;br /&gt;   if two then&lt;br /&gt;       r = r + 1&lt;br /&gt;       if ten(5) &lt;&gt; 0 and tots(5) &lt;&gt; 0 and tots(9) &lt;&gt; 0 then&lt;br /&gt;           temp1 = rounding(lshares * tots(5) / tots(9), 3)&lt;br /&gt;           temp2 = lbasis - temp2&lt;br /&gt;       end if&lt;br /&gt;&lt;br /&gt;       oSheet.getcellbyposition(0,r).value = temp1&lt;br /&gt;       oSheet.getcellbyposition(9,r).value = temp2&lt;br /&gt;       oSheet.getcellbyposition(1,r).string = tname2&lt;br /&gt;       oSheet.getcellbyposition(8,r).string = tbroker2&lt;br /&gt;       if tots(7) &lt;&gt; 0 and temp1 &lt;&gt; 0 then&lt;br /&gt;           temp3 = rounding(lshares * tots(7) / tots(9), 3)&lt;br /&gt;           call CopyLine(trange, tsheet, 0, r-clrw(1), trange, tsheet, 0, r + 1-clrw(1), 0)&lt;br /&gt;           if ten(1) = tname2 and ten(8) = tbroker2 then n = n + 1      &lt;br /&gt;           oSheet.getcellbyposition(0,r).value = temp3&lt;br /&gt;           oSheet.getcellbyposition(0,r+1).value = temp1 - temp3&lt;br /&gt;           oSheet.getcellbyposition(9,r).value = rounding(temp2 * temp3 / temp1,2)&lt;br /&gt;           oSheet.getcellbyposition(9,r+1).value = temp2 - rounding(temp2 * temp3 / temp1,2)&lt;br /&gt;           oSheet.getcellbyposition(6,r).string = "frac." &amp;amp; ten(6)&lt;br /&gt;           tots(7) = tots(7) - temp1 + temp3&lt;br /&gt;       end if  &lt;br /&gt;       tots(8) = tots(8) - lbasis&lt;br /&gt;       tots(6) = tots(6) - temp2&lt;br /&gt;       tots(9) = tots(9) - lshares&lt;br /&gt;       tots(5) = tots(5) - temp1&lt;br /&gt;   end if&lt;br /&gt;&lt;br /&gt;loop&lt;br /&gt;if ten(6) = "transfer" or ten(6) = "exchange" then&lt;br /&gt;   tbasis2 = tots(3)&lt;br /&gt;'    msgbox tbasis2&lt;br /&gt;'    msgbox temp2&lt;br /&gt;   ten(9) = tots(6)&lt;br /&gt;   oRange = ThisComponent.Sheets.getByName("Data").getCellRangeByName("All")&lt;br /&gt;   thiscomponent.getcurrentcontroller.select(oRange)&lt;br /&gt;&lt;br /&gt;   oRange.getcellbyposition(9,1).value = ten(9)&lt;br /&gt;'    msgbox ten(9)&lt;br /&gt;   Call CopyLine("all", "Data", 0, 1, trange2, tsheet, 0, 1, 0)&lt;br /&gt;end if&lt;br /&gt;'msgbox tbasis2&lt;br /&gt;'msgbox tshares2&lt;br /&gt;'for j = 0 to ubound(tots)&lt;br /&gt;'msgbox tots(j) &amp; "  " &amp;amp; j&lt;br /&gt;'next&lt;br /&gt;&lt;br /&gt;'change name of fund sheet&lt;br /&gt;If tfield = "fund" And oSheet.name &lt;&gt; tname2 Then&lt;br /&gt;   temp = InputBox("What is the full name of the the ""new"" fund?" &amp; _&lt;br /&gt;       Chr(10) &amp;amp; "OK to leave blank.")&lt;br /&gt;   if temp = "" then temp = tname2&lt;br /&gt;   oSheet.rows.insertbyindex(0,1)&lt;br /&gt;   oSheet.getcellbyposition(0,0).string = temp&lt;br /&gt;   oSheet.getcellbyposition(0,0).CharColor = 16711680 'red&lt;br /&gt;   oSheet.name = tname2&lt;br /&gt;End If&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;End Sub&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/21667255-4161316524897957049?l=basic1605.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://basic1605.blogspot.com/feeds/4161316524897957049/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=21667255&amp;postID=4161316524897957049' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/21667255/posts/default/4161316524897957049'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/21667255/posts/default/4161316524897957049'/><link rel='alternate' type='text/html' href='http://basic1605.blogspot.com/2007/09/finally-redid-this.html' title='finally, redid this'/><author><name>Carol</name><uri>http://www.blogger.com/profile/18378658078131278144</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-21667255.post-116319411289506506</id><published>2006-11-10T13:18:00.000-08:00</published><updated>2006-11-10T13:28:32.946-08:00</updated><title type='text'>Arrays as subroutine arguments</title><content type='html'>In the last version of VBA that I used, if one wanted to use an array as an argument in a subroutine or function, one was limited to one array which had to be the last argument.  This isn't the case with ooo basic.  One or more arguments can be arrays, and arrays can be placed anywhere in the argument list.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/21667255-116319411289506506?l=basic1605.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://basic1605.blogspot.com/feeds/116319411289506506/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=21667255&amp;postID=116319411289506506' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/21667255/posts/default/116319411289506506'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/21667255/posts/default/116319411289506506'/><link rel='alternate' type='text/html' href='http://basic1605.blogspot.com/2006/11/arrays-as-subroutine-arguments.html' title='Arrays as subroutine arguments'/><author><name>Carol</name><uri>http://www.blogger.com/profile/18378658078131278144</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-21667255.post-116308567384438156</id><published>2006-11-09T07:09:00.000-08:00</published><updated>2006-11-11T13:42:33.716-08:00</updated><title type='text'>start to Main</title><content type='html'>This is the start to my main macro. I'm putting it here so it's less likely for me to lose it again. It just shows different ways to get info from a dialog.&lt;br /&gt;&lt;span style="font-size:85%;"&gt;&lt;br /&gt;dim ten(9)&lt;br /&gt;oDSheet = ThisComponent.Sheets.getbyName("Data")&lt;br /&gt;oDRange = ThisComponent.Sheets.getByName("Data").getCellbyposition(0,0)&lt;br /&gt;ThisComponent.getCurrentController.select(oDRange)&lt;br /&gt;&lt;br /&gt;with oDialog1&lt;br /&gt;    tfield = .getcontrol("ListField").getselecteditem()&lt;br /&gt;    dsn = .getcontrol("Label1").text&lt;br /&gt;    if .getcontrol("CheckNegAdj").state then&lt;br /&gt;        n = right(dsn,1)&lt;br /&gt;        if n = "1" then n = "0" else n = "1"&lt;br /&gt;        dsn = left(dsn,2) &amp; n&lt;br /&gt;    end if&lt;br /&gt;    PPS = .getcontrol("NumPPS").value&lt;br /&gt;&lt;br /&gt;    ten(0) = .getcontrol("NumShares").value&lt;br /&gt;        if mid(dsn,2,1) then&lt;br /&gt;            if ten(0) = 0 then msgbox "number of shares?" : exit sub&lt;br /&gt;            if right(dsn,1) = "1" and ten(0) &gt; 0 then ten(0) = 0 - ten(0)&lt;br /&gt;            if right(dsn,1) = "0" and ten(0) &lt; 0 then ten(0) = 0 - ten(0)&lt;br /&gt;        else&lt;br /&gt;            ten(0) = ""&lt;br /&gt;        end if&lt;br /&gt;    ten(1) = .getcontrol("ComboName").text&lt;br /&gt;        if ten(1) = "" then&lt;br /&gt;            if .getcontrol("CheckChange").state then&lt;br /&gt;                answer = msgbox("Is this a broker name change?",4,"name change/transfer")&lt;br /&gt;                if answer &lt;&gt; 6 then msgbox tfield &amp; " name?" : exit sub&lt;br /&gt;            else&lt;br /&gt;                 msgbox tfield &amp; " name?" : exit sub&lt;br /&gt;            end if&lt;br /&gt;        end if&lt;br /&gt;    ten(2) = .getcontrol("DateField1").text&lt;br /&gt;        if not isdate(ten(2)) then msgbox "date is not date" : exit sub&lt;br /&gt;        if datediff("d",ten(2),now) &lt; 0 then msgbox "date is in future" : exit sub&lt;br /&gt;    date1 = ten(2)&lt;br /&gt;    ten(3) = year(ten(2))&lt;br /&gt;    ten(4) = choose(month(ten(2)),1,1,1,2,2,2,3,3,3,4,4,4)&lt;br /&gt;        if month(ten(2)) = 1 and day(ten(2)) &lt; 5 then&lt;br /&gt;            answer = MsgBox("Should this be reported as previous year income?", 4, "Reportable")&lt;br /&gt;            If answer = 6 Then&lt;br /&gt;                ten(3) = ten(3) - 1&lt;br /&gt;                ten(4) = 4&lt;br /&gt;                ten(7) = "reportable " &amp; ten(3) &amp;amp; " " &amp; ten(7)&lt;br /&gt;            End If&lt;br /&gt;        end if&lt;br /&gt;    ten(5) = .getcontrol("NumCash").value&lt;br /&gt;        if left(dsn,1) then&lt;br /&gt;            if ten(5) = 0 then msgbox "cash amount?" : exit sub&lt;br /&gt;            if right(dsn,1) = "1" and ten(5) &gt; 0 then ten(5) = 0 - ten(5)&lt;br /&gt;            if right(dsn,1) = "0" and ten(5) &lt; 0 then ten(5) = 0 - ten(5)   &lt;br /&gt;        else&lt;br /&gt;            ten(5) = ""&lt;br /&gt;        end if&lt;br /&gt;    ten(6) = .getcontrol("ComboType").text&lt;br /&gt;        if .getcontrol("CheckPPS").state then ten(6) = "PPS"&lt;br /&gt;        if .getcontrol("CheckLieu").state then ten(6) = "cash in lieu"&lt;br /&gt;        if tfield = "cash" and ten(6) = "div" then&lt;br /&gt;            temp = msgbox("Is this a mm div?",4,"mm div?")&lt;br /&gt;            if temp = 6 then ten(6) = "mm div"&lt;br /&gt;            if ten(6) = "buy" then ten(6) = "dep"&lt;br /&gt;            if ten(6) = "sell" then ten(6) = "wth"&lt;br /&gt;        end if&lt;br /&gt;        if ten(6) = "" then msgbox "transaction?" : exit sub&lt;br /&gt;        if .getcontrol("CheckNonTax").state then&lt;br /&gt;            ten(6) = "non " &amp; ten(6)&lt;br /&gt;            temp = msgbox("Is this reportable?",4 + 256,"Reportable?")&lt;br /&gt;            if temp = 7 then ten(6) = "n " &amp; ten(6)&lt;br /&gt;        end if&lt;br /&gt;        if .getcontrol("CheckChange").state then&lt;br /&gt;            ten(6) = "change"&lt;br /&gt;        else&lt;br /&gt;            if .getcontrol("CheckCorrection").state then&lt;br /&gt;                oldtype = ten(6)&lt;br /&gt;                ten(6) = .getcontrol("ComboCorrection").text&lt;br /&gt;                if ten(6) = "" then msgbox "new transaction type?" : exit sub&lt;br /&gt;            end if       &lt;br /&gt;        end if&lt;br /&gt;               &lt;br /&gt;    ten(7) = .getcontrol("TextComments").text&lt;br /&gt;        if .getcontrol("CheckNegAdj").state then ten(7) = "Correction--" &amp; ten(7)&lt;br /&gt;    ten(8) = .getcontrol("ComboBroker").text&lt;br /&gt;    ten(9) = ""   &lt;br /&gt;        if val(ten(5)) &lt;&gt; 0 then   &lt;br /&gt;            if tfield = "cash" then&lt;br /&gt;                if ten(6) = "dep" or ten(6) = "wth" then ten(0) = ten(5)   &lt;br /&gt;                if .getcontrol("CheckReinv").state then ten(0) = ten(5)&lt;br /&gt;            end if&lt;br /&gt;            if val(ten(0)) &lt;&gt; 0 then&lt;br /&gt;                ten(9) = ten(5)&lt;br /&gt;                if PPS = 0 then PPS = Rounding(ten(5)/ten(0),3)&lt;br /&gt;            end if&lt;br /&gt;        end if&lt;br /&gt;end with&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/21667255-116308567384438156?l=basic1605.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://basic1605.blogspot.com/feeds/116308567384438156/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=21667255&amp;postID=116308567384438156' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/21667255/posts/default/116308567384438156'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/21667255/posts/default/116308567384438156'/><link rel='alternate' type='text/html' href='http://basic1605.blogspot.com/2006/11/start-to-main.html' title='start to Main'/><author><name>Carol</name><uri>http://www.blogger.com/profile/18378658078131278144</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-21667255.post-116066446209323684</id><published>2006-10-12T07:39:00.000-07:00</published><updated>2006-10-12T07:47:42.096-07:00</updated><title type='text'>revised Search</title><content type='html'>Here is the Search function from before, revised to include the macro SheetObj. SheetObj and SheetName are in other posts here. (Both the start and the end of the macro have been changed, the latter for date searches.)&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:85%;"&gt;Function FindTriple(trange, tsheet, c, r, tname, tname2, offset2, tname3, offset3, n, go)&lt;br /&gt;'if c (or r) is a number, look for nth occurence in column c (or row r) of trange on tsheet&lt;br /&gt; 'with tname2 offset offset2 cols and tname3 offset offset3 cols&lt;br /&gt;'columns and rows start at 0 ...  c and r are initially range (not sheet) references&lt;br /&gt;'before calling function, set r (or c) to "" to search all rows (or all columns)&lt;br /&gt;'returns sheet (not range) col c and row r where found, or if not found first cell of searched range,&lt;br /&gt;'or ...  col and row of last cell where found (for n &gt; 1)&lt;br /&gt;'trange can be chosen as "" to search entire sheet or an entire column or row&lt;br /&gt;'if both trange and tsheet are "", current selection is searched&lt;br /&gt;'tname2 or tname3 can be chosen as "" for simpler searches&lt;br /&gt;&lt;br /&gt;FindTriple = 0&lt;br /&gt;oDoc = ThisComponent&lt;br /&gt;dim clrw(3)&lt;br /&gt;oSheet = SheetObj(trange,tsheet,clrw())&lt;br /&gt;&lt;br /&gt;if isnumeric(c) then clrw(0) = clrw(0) + c : clrw(2) = clrw(0)'to search in only one column&lt;br /&gt;if isnumeric(r) then clrw(1) = clrw(1) + r : clrw(3) = clrw(1)'to search in only one row&lt;br /&gt;oRange = oSheet.getcellrangebyposition(clrw(0), clrw(1), clrw(2), clrw(3))&lt;br /&gt;oCell = oSheet.getcellbyposition(clrw(0), clrw(1))&lt;br /&gt;c = clrw(0)'change from range coordinates to sheet coordinates&lt;br /&gt;r = clrw(1)&lt;br /&gt;&lt;br /&gt;k = 0&lt;br /&gt;if tname = oCell.string then gosub FoundOne&lt;br /&gt;&lt;br /&gt;xSearchD = oRange.createSearchDescriptor()&lt;br /&gt;With xSearchD&lt;br /&gt; .SearchString = tname&lt;br /&gt; .SearchCaseSensitive = false&lt;br /&gt; .SearchWords = true 'forces the entire cell to contain only the search string&lt;br /&gt;End With&lt;br /&gt;&lt;br /&gt;do&lt;br /&gt; xFound = oCell&lt;br /&gt; xFound = oRange.findNext(xFound, xSearchD)&lt;br /&gt; if IsNull(xFound) then exit do&lt;br /&gt; oCell = xFound&lt;br /&gt; gosub FoundOne&lt;br /&gt;loop&lt;br /&gt;exit function&lt;br /&gt;&lt;br /&gt;FoundOne:&lt;br /&gt;c = oCell.rangeaddress.startcolumn&lt;br /&gt;r = oCell.rangeaddress.startrow&lt;br /&gt;temp2 = oSheet.getcellbyposition(c + offset2,r).string&lt;br /&gt;temp3 = oSheet.getcellbyposition(c + offset3,r).string&lt;br /&gt;&lt;br /&gt;if len(tname2) &gt; 2 and temp2 &lt;&gt; tname2 then return&lt;br /&gt;&lt;br /&gt;if len(tname3) &lt; 2 then &lt;br /&gt; k = k + 1&lt;br /&gt;else&lt;br /&gt; if isdate(tname3) and isdate(temp3) then&lt;br /&gt;  temp = DateDiff("d",tname3,temp3)&lt;br /&gt;  if temp &gt; 1 and temp &lt; 5 then k = k + 1&lt;br /&gt; else&lt;br /&gt;  if temp3 = tname3 then k = k + 1&lt;br /&gt; end if&lt;br /&gt;end if&lt;br /&gt;If k = n Then&lt;br /&gt; FindTriple = -1&lt;br /&gt; If go Then&lt;br /&gt;  oCell = oSheet.getcellbyposition(c,r)&lt;br /&gt;  oDoc.getCurrentController.select(oCell)&lt;br /&gt; End If&lt;br /&gt; exit function&lt;br /&gt;End If&lt;br /&gt;Return&lt;br /&gt;End Function&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/21667255-116066446209323684?l=basic1605.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://basic1605.blogspot.com/feeds/116066446209323684/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=21667255&amp;postID=116066446209323684' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/21667255/posts/default/116066446209323684'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/21667255/posts/default/116066446209323684'/><link rel='alternate' type='text/html' href='http://basic1605.blogspot.com/2006/10/revised-search.html' title='revised Search'/><author><name>Carol</name><uri>http://www.blogger.com/profile/18378658078131278144</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-21667255.post-116049355351094453</id><published>2006-10-10T08:04:00.000-07:00</published><updated>2006-10-10T08:19:13.553-07:00</updated><title type='text'>Open dialog</title><content type='html'>From my limited experience, it seems that all the macros that refer to a given dialog have to be on the same page (ie the same basic module).  A library can have quite a few other basic module (pages).  Mine has modules named: Main, Merger, NewYear, Place, Refresh, Search, SimCity, SSum, and Taxes.  (The macro in the SimCity module is to sort and reformat a range containing info on rewards and other plop-able "buildings" in SimCity4.)  There is also a dialog module in the library called Dialog1.  Here's the beginning of the Main module with a macro which opens a dialog with some hidden controls and a combo box populated with elements from a range in a document.  The library itself is called "Accounts".&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:85%;"&gt;Dim oDialog1 as Object&lt;br /&gt;dim oControl as Object&lt;br /&gt;dim oDoc as Variant&lt;br /&gt;&lt;br /&gt;Sub Dialog1Show '---------------open Dialog1, populate ComboBroker----------------------&lt;br /&gt;oDoc  = ThisComponent&lt;br /&gt;DialogLibraries.LoadLibrary( "Standard" )&lt;br /&gt;oDialog1 = CreateUnoDialog( DialogLibraries.Accounts.Dialog1 )&lt;br /&gt;oControl = oDialog1.getcontrol("ComboBroker")&lt;br /&gt;&lt;br /&gt;oSheet = ThisComponent.Sheets.getbyname("Misc")&lt;br /&gt;oRange = oSheet.getcellrangebyname("Brokers")&lt;br /&gt;&lt;br /&gt;for j = 1 to oRange.rows.count -1'first line is column heading&lt;br /&gt;    temp = oRange.getcellbyposition(0,j).string&lt;br /&gt;    oControl.additem(temp,0)&lt;br /&gt;next&lt;br /&gt;&lt;br /&gt;'make option buttons invisible&lt;br /&gt;for j = 1 to 5&lt;br /&gt;    oDialog1.getcontrol("OptionButton" &amp;amp; j).setvisible(0)&lt;br /&gt;next&lt;br /&gt;oDialog1.getcontrol("ComboCorrection").setvisible(0)&lt;br /&gt;&lt;br /&gt;oDialog1.Execute()&lt;br /&gt;&lt;br /&gt;End Sub&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/21667255-116049355351094453?l=basic1605.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://basic1605.blogspot.com/feeds/116049355351094453/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=21667255&amp;postID=116049355351094453' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/21667255/posts/default/116049355351094453'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/21667255/posts/default/116049355351094453'/><link rel='alternate' type='text/html' href='http://basic1605.blogspot.com/2006/10/open-dialog.html' title='Open dialog'/><author><name>Carol</name><uri>http://www.blogger.com/profile/18378658078131278144</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-21667255.post-116040549220708191</id><published>2006-10-09T07:46:00.000-07:00</published><updated>2006-10-12T07:39:18.610-07:00</updated><title type='text'>Sheet object</title><content type='html'>After I found myself copying the first few lines of the search macro into another macro, I decided to make them into their own macro.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:85%;"&gt;Function SheetObj(trange,tsheet,clrw())&lt;br /&gt;'trange can be chosen as "" to get entire sheet and coordinates for entire sheet, not just range on sheet&lt;br /&gt;'if both trange and tsheet are "", current selection is searched&lt;br /&gt;'do not "dim clrw(3)"here, it's equivalent to putting redim clrw(3) at the end of the macro&lt;br /&gt;oSheets = ThisComponent.sheets&lt;br /&gt;oRanges = ThisComponent.namedranges&lt;br /&gt;if oSheets.hasbyname(tsheet) then&lt;br /&gt;  SheetObj = oSheets.getbyname(tsheet)&lt;br /&gt;  oRange = SheetObj'changed later if trange &lt;&gt; ""&lt;br /&gt;else&lt;br /&gt;  if oRanges.hasbyname(trange) then&lt;br /&gt;      tsheet = SheetName(trange,0)&lt;br /&gt;      SheetObj = oSheets.getbyname(tsheet)&lt;br /&gt;  else&lt;br /&gt;      SheetObj = ThisComponent.CurrentController.getActiveSheet&lt;br /&gt;      oRange = ThisComponent.getcurrentselection()     &lt;br /&gt;  end if&lt;br /&gt;end if&lt;br /&gt;&lt;br /&gt;if oRanges.hasbyname(trange) and trange &lt;&gt; "" then oRange = SheetObj.getcellrangebyname(trange)&lt;br /&gt;if isnull(oRange) then oRange = SheetObj&lt;br /&gt;&lt;br /&gt;with oRange.rangeaddress&lt;br /&gt;  clrw(0) = .startcolumn&lt;br /&gt;  clrw(1) = .startrow&lt;br /&gt;  clrw(2) = .endcolumn&lt;br /&gt;  clrw(3) = .endrow&lt;br /&gt;end with&lt;br /&gt;end function&lt;br /&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/21667255-116040549220708191?l=basic1605.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://basic1605.blogspot.com/feeds/116040549220708191/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=21667255&amp;postID=116040549220708191' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/21667255/posts/default/116040549220708191'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/21667255/posts/default/116040549220708191'/><link rel='alternate' type='text/html' href='http://basic1605.blogspot.com/2006/10/sheet-object.html' title='Sheet object'/><author><name>Carol</name><uri>http://www.blogger.com/profile/18378658078131278144</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-21667255.post-116016874825058909</id><published>2006-10-06T14:02:00.000-07:00</published><updated>2006-10-06T14:27:36.296-07:00</updated><title type='text'>Find number in string; also Sort</title><content type='html'>The first macro finds the first number (not a single digit but an entire number) in a string. The second sorts a range which may or may not have a header.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:85%;"&gt;Function FindNum(ttext)&lt;br /&gt;'returns the first number expression in ttext&lt;br /&gt;n = 1&lt;br /&gt;Do While n &lt;&gt; " " then exit do&lt;br /&gt;  n = n + 1&lt;br /&gt;Loop&lt;br /&gt;FindNum = Val(Mid(ttext, n))&lt;br /&gt;end Function&lt;br /&gt;&lt;br /&gt;Sub Sorting(trange,tsheet,c1,c2,c3,dir1,dir2,dir3,header)&lt;br /&gt;myarray1 = Array(c1,c2,c3)'range cols start w 0 as the first one&lt;br /&gt;myarray2 = Array(dir1,dir2,dir3)'dir = true for ascending or false otherwise&lt;br /&gt;n = -isnumeric(c1) - isnumeric(c2) - isnumeric(c3)&lt;br /&gt;if n = 0 then exit sub&lt;br /&gt;Dim aSortFields(n) as New com.sun.star.util.SortField&lt;br /&gt;Dim aSortDesc(1) as New com.sun.star.beans.PropertyValue&lt;br /&gt;&lt;br /&gt;oSheet = ThisComponent.Sheets.getByName(tsheet)&lt;br /&gt;oRange = oSheet.getCellRangeByName(trange)&lt;br /&gt;&lt;br /&gt;for j = 0 to n-1&lt;br /&gt;  aSortFields(j).Field = myarray1(j)&lt;br /&gt;  aSortFields(j).SortAscending = myarray2(j)&lt;br /&gt;next&lt;br /&gt;&lt;br /&gt;aSortDesc(0).Name = "SortFields"&lt;br /&gt;aSortDesc(0).Value = aSortFields()&lt;br /&gt;aSortDesc(1).Name = "ContainsHeader"&lt;br /&gt;aSortDesc(1).Value = header&lt;br /&gt;&lt;br /&gt;oRange.Sort(aSortDesc())&lt;br /&gt;End Sub&lt;br /&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/21667255-116016874825058909?l=basic1605.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://basic1605.blogspot.com/feeds/116016874825058909/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=21667255&amp;postID=116016874825058909' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/21667255/posts/default/116016874825058909'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/21667255/posts/default/116016874825058909'/><link rel='alternate' type='text/html' href='http://basic1605.blogspot.com/2006/10/find-number-in-string-also-sort.html' title='Find number in string; also Sort'/><author><name>Carol</name><uri>http://www.blogger.com/profile/18378658078131278144</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-21667255.post-115997413257907751</id><published>2006-10-04T07:57:00.000-07:00</published><updated>2006-10-04T08:02:12.593-07:00</updated><title type='text'>Current / used area</title><content type='html'>a very short macro&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:78%;"&gt;Sub FindRange(tsheet, c1, r1, c2, r2, ttype)&lt;br /&gt;'finds end of either current or used area&lt;br /&gt;oSheet = ThisComponent.sheets.getbyname(tsheet)&lt;br /&gt;oCell = oSheet.getcellbyposition(c1,r1)&lt;br /&gt;oCursor = oSheet.createCursorbyrange(oCell)&lt;br /&gt;&lt;br /&gt;if ttype = "current" then&lt;br /&gt;    oCursor.gotoEnd&lt;br /&gt;elseif ttype = "used" then&lt;br /&gt;    oCursor.gotoEndOfUsedArea(true)&lt;br /&gt;end if&lt;br /&gt;&lt;br /&gt;c2 = oCursor.rangeaddress.endcolumn&lt;br /&gt;r2 = oCursor.rangeaddress.endrow&lt;br /&gt;End Sub&lt;br /&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/21667255-115997413257907751?l=basic1605.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://basic1605.blogspot.com/feeds/115997413257907751/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=21667255&amp;postID=115997413257907751' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/21667255/posts/default/115997413257907751'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/21667255/posts/default/115997413257907751'/><link rel='alternate' type='text/html' href='http://basic1605.blogspot.com/2006/10/current-used-area.html' title='Current / used area'/><author><name>Carol</name><uri>http://www.blogger.com/profile/18378658078131278144</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-21667255.post-115988700800519146</id><published>2006-10-03T07:35:00.000-07:00</published><updated>2006-10-04T12:34:40.630-07:00</updated><title type='text'>Search</title><content type='html'>This macro searches records in a range to find a record that matches up to 3 criteria.  The function itself returns true or false.  If the first criteria one wants to match is in range column 0, for example, before calling the function, set c = 0 and r = "".  If the record is found, the sheet column and row of the found record will be returned as well.  This also does simple searches.  (FindSheet is a function.  It returns the name of a sheet that a given range is on.)&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:78%;"&gt;Function FindTriple(trange, tsheet, c, r, tname, tname2, offset2, tname3, offset3, n, go) as Boolean&lt;br /&gt;'if c (or r) is a number, look for nth occurence in column c (or row r) of trange on tsheet&lt;br /&gt;    'with tname2 offset offset2 cols and tname3 offset offset3 cols&lt;br /&gt;'columns and rows start at 0 ...  c and r are initially range (not sheet) references&lt;br /&gt;'before calling function, set r (or c) to "" to search all rows (or all columns)&lt;br /&gt;'returns sheet (not range) col c and row r where found, or if not found first cell of searched range,&lt;br /&gt;'or ...  col and row of last cell where found (for n &gt; 1)&lt;br /&gt;'trange can be chosen as "" to search entire sheet&lt;br /&gt;'if both trange and tsheet are "", current selection is searched&lt;br /&gt;'tname2 or tname3 can be chosen as "" for simpler searches&lt;br /&gt;&lt;br /&gt;FindTriple = 0&lt;br /&gt;oDoc = ThisComponent&lt;br /&gt;&lt;br /&gt;if oDoc.sheets.hasbyname(tsheet) then&lt;br /&gt;    oSheet = oDoc.sheets.getbyname(tsheet)&lt;br /&gt;    if oDoc.NamedRanges.hasByName(trange) then&lt;br /&gt;        oRange = oSheet.getcellrangebyname(trange)&lt;br /&gt;    else&lt;br /&gt;        oRange = oSheet&lt;br /&gt;    end if&lt;br /&gt;else&lt;br /&gt;    if oDoc.NamedRanges.hasByName(trange) then&lt;br /&gt;        tsheet = FindSheet(trange,0)&lt;br /&gt;        oSheet = oDoc.sheets.getbyname(tsheet)&lt;br /&gt;        oRange = oSheet.getcellrangebyname(trange)&lt;br /&gt;    else&lt;br /&gt;        oSheet = oDoc.CurrentController.getActiveSheet&lt;br /&gt;        oRange = oDoc.getcurrentselection()&lt;br /&gt;        if isnull(oRange) then oRange = oSheet&lt;br /&gt;    end if&lt;br /&gt;end if&lt;br /&gt;&lt;br /&gt;with oRange.rangeaddress&lt;br /&gt;    c1 = .startcolumn&lt;br /&gt;    c2 = .endcolumn&lt;br /&gt;    r1 = .startrow&lt;br /&gt;    r2 = .endrow&lt;br /&gt;end with&lt;br /&gt;&lt;br /&gt;if isnumeric(c) then c1 = c1 + c : c2 = c1'to search in only one column&lt;br /&gt;if isnumeric(r) then r1 = r1 + r : r2 = r1'to search in only one row&lt;br /&gt;oRange = oSheet.getcellrangebyposition(c1, r1, c2, r2)&lt;br /&gt;oCell = oSheet.getcellbyposition(c1, r1)&lt;br /&gt;c = c1&lt;br /&gt;r = r1&lt;br /&gt;k = 0&lt;br /&gt;if tname = oCell.string then gosub FoundOne&lt;br /&gt;&lt;br /&gt;xSearchD = oRange.createSearchDescriptor()&lt;br /&gt;With xSearchD&lt;br /&gt;    .SearchString = tname&lt;br /&gt;    .SearchCaseSensitive = false&lt;br /&gt;    .SearchWords = true&lt;br /&gt;        REM SearchWords forces the entire cell to contain only the search string&lt;br /&gt;        'from Andrew Pitonyak's ooDocument.  He used bWholeWord instead of true&lt;br /&gt;    '.SearchWords = bWholeWord&lt;br /&gt;End With&lt;br /&gt;&lt;br /&gt;do&lt;br /&gt;    xFound = oCell&lt;br /&gt;    xFound = oRange.findNext(xFound, xSearchD)&lt;br /&gt;    if IsNull(xFound) then exit do&lt;br /&gt;    oCell = xFound&lt;br /&gt;    gosub FoundOne&lt;br /&gt;loop&lt;br /&gt;exit function&lt;br /&gt;&lt;br /&gt;FoundOne:&lt;br /&gt;c = oCell.rangeaddress.startcolumn&lt;br /&gt;r = oCell.rangeaddress.startrow&lt;br /&gt;temp2 = oSheet.getcellbyposition(c + offset2,r).string&lt;br /&gt;temp3 = oSheet.getcellbyposition(c + offset3,r).string&lt;br /&gt;if (len(tname2) &lt; 2 or temp2 = tname2) _&lt;br /&gt;    and (len(tname3) &lt; 2 or temp3 = tname3) then k = k + 1&lt;br /&gt;If k = n Then&lt;br /&gt;    FindTriple = -1&lt;br /&gt;    If go Then&lt;br /&gt;        oCell = oSheet.getcellbyposition(c,r)&lt;br /&gt;        oDoc.getCurrentController.select(oCell)&lt;br /&gt;    End If&lt;br /&gt;    exit function&lt;br /&gt;End If&lt;br /&gt;Return&lt;br /&gt;End Function&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/21667255-115988700800519146?l=basic1605.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://basic1605.blogspot.com/feeds/115988700800519146/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=21667255&amp;postID=115988700800519146' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/21667255/posts/default/115988700800519146'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/21667255/posts/default/115988700800519146'/><link rel='alternate' type='text/html' href='http://basic1605.blogspot.com/2006/10/search.html' title='Search'/><author><name>Carol</name><uri>http://www.blogger.com/profile/18378658078131278144</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-21667255.post-115980205519116540</id><published>2006-10-02T08:07:00.000-07:00</published><updated>2006-10-09T07:34:35.653-07:00</updated><title type='text'>Create range, Column number to letter, Rounding</title><content type='html'>Three short macros ... The first creates a named range. The second converts a column number to a letter. (Note: Column 0 is column A, column 26 is column AA. Also, row 0 is row 1.) The third rounds a number to n decimal places.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:78%;"&gt;Sub NewRange(trange, tsheet, c1, r1, c2, r2)&lt;br /&gt;'defines trange on tsheet with these coordinates&lt;br /&gt;if trange = "" then exit sub&lt;br /&gt;r1 = r1 + 1 : r2 = r2 + 1&lt;br /&gt;temp = "$" &amp; tsheet &amp;amp;amp;amp;amp; ".$" &amp; Letter(c1) &amp;amp; "$" &amp; r1 &amp;amp; ":$" &amp; Letter(c2) &amp;amp; "$" &amp; r2&lt;br /&gt;with ThisComponent.NamedRanges&lt;br /&gt; If .hasByName(trange) Then .removeByName (trange)&lt;br /&gt; .addNewByName(trange, temp, createUnoStruct( "com.sun.star.table.CellAddress" ),0 )&lt;br /&gt;end with&lt;br /&gt;r1 = r1 - 1 : r2 = r2 - 1&lt;br /&gt;End Sub&lt;br /&gt;&lt;br /&gt;Function Letter(c)&lt;br /&gt;temp = Int(c/26)&lt;br /&gt;if temp &gt; 0 then Letter = Chr(64 + temp)  else Letter = ""&lt;br /&gt;Letter = Letter &amp;amp; Chr(65 + c - 26 * temp)&lt;br /&gt;End Function&lt;br /&gt;&lt;/span&gt;&lt;span style="font-size:78%;"&gt;&lt;br /&gt;Function Rounding(x,n)' rounds x to n decimal places&lt;br /&gt;Rounding = int(x * 10^n)/10^n&lt;br /&gt;end Function&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/21667255-115980205519116540?l=basic1605.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://basic1605.blogspot.com/feeds/115980205519116540/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=21667255&amp;postID=115980205519116540' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/21667255/posts/default/115980205519116540'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/21667255/posts/default/115980205519116540'/><link rel='alternate' type='text/html' href='http://basic1605.blogspot.com/2006/10/create-range-column-number-to-letter.html' title='Create range, Column number to letter, Rounding'/><author><name>Carol</name><uri>http://www.blogger.com/profile/18378658078131278144</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-21667255.post-115958188024704826</id><published>2006-09-29T18:44:00.000-07:00</published><updated>2006-09-29T19:04:40.260-07:00</updated><title type='text'>saving a dialog</title><content type='html'>I recently updated Open Office and clicked the wrong button and lost all the macros and the dialog that I had spent so long on.  They were nowhere to be found.  However, in looking through computer files and then finally doing a search at the &lt;a href="http://www.oooforum.org/forum/viewtopic.phtml?t=12884"&gt;OpenOffice Forum&lt;/a&gt;, I now know where my newly created macros are -- which doesn't help too much since they're  pretty well buried.&lt;br /&gt;However, while playing around, I found out that one can "export" a library of macros and dialogs.  So, now I have the library that I'm recreating copied to a folder on the desktop.  It could be worse.  I still have my old Visual Basic macros and dialog.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/21667255-115958188024704826?l=basic1605.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://basic1605.blogspot.com/feeds/115958188024704826/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=21667255&amp;postID=115958188024704826' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/21667255/posts/default/115958188024704826'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/21667255/posts/default/115958188024704826'/><link rel='alternate' type='text/html' href='http://basic1605.blogspot.com/2006/09/saving-dialog.html' title='saving a dialog'/><author><name>Carol</name><uri>http://www.blogger.com/profile/18378658078131278144</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-21667255.post-115116729238739781</id><published>2006-06-24T09:35:00.000-07:00</published><updated>2006-06-24T09:41:32.400-07:00</updated><title type='text'>load speed</title><content type='html'>&lt;span style="font-size:85%;"&gt;It's amazing what a little change can make. I was complaining to one of my sons about how slow Open Office loaded. He went to options and unchecked Java runtime environment.  Now Open Office loads much more quickly.&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/21667255-115116729238739781?l=basic1605.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://basic1605.blogspot.com/feeds/115116729238739781/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=21667255&amp;postID=115116729238739781' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/21667255/posts/default/115116729238739781'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/21667255/posts/default/115116729238739781'/><link rel='alternate' type='text/html' href='http://basic1605.blogspot.com/2006/06/load-speed.html' title='load speed'/><author><name>Carol</name><uri>http://www.blogger.com/profile/18378658078131278144</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-21667255.post-114166344123166655</id><published>2006-03-06T08:29:00.000-08:00</published><updated>2006-03-06T08:45:16.053-08:00</updated><title type='text'>objects</title><content type='html'>&lt;span style="font-size:85%;"&gt;I don't know if I just didn't know enough Visual Basic to make full use of objects. However, I'm finding that it's natural to change the find-something-or-other functions that I wrote to return an object instead of a boolean and then to check the object to see if it has the characteristic (such as the right string value) that I was searching for. (The FindFirst function that comes with OOo Basic returns an object -- a cell -- if the search was successful.) I'm also finding that I'm not creating temporary range names (as I did in VB) but instead just using oCell= or oRange= .&lt;br /&gt;On another vein, I also find I'm liking using the Input function followed by a MsgBox function that says in effect "Are you sure?" as recommended in the Help info for Input function.&lt;br /&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/21667255-114166344123166655?l=basic1605.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://basic1605.blogspot.com/feeds/114166344123166655/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=21667255&amp;postID=114166344123166655' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/21667255/posts/default/114166344123166655'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/21667255/posts/default/114166344123166655'/><link rel='alternate' type='text/html' href='http://basic1605.blogspot.com/2006/03/objects.html' title='objects'/><author><name>Carol</name><uri>http://www.blogger.com/profile/18378658078131278144</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-21667255.post-114140018187960810</id><published>2006-03-03T07:24:00.000-08:00</published><updated>2006-03-03T07:36:21.896-08:00</updated><title type='text'>sorting</title><content type='html'>&lt;span style="font-size:85%;"&gt;I was reading the OpenOffice forum message boards and saw a question about sorting on more than 3 categories.  I haven't joined the forum since I know very little about Basic but thought I'd at least write down my thoughts somewhere.  To sort on, say, 5 categories, first sort on the last two then sort the result on the first 3.&lt;br /&gt;Finally, I'm finding that it isn't as hard as I thought to rewrite macros from Visual Basic to OOo Basic.   There are a few differences to keep one on one's toes, of course.  A few of the provided macro functions are different (like IFF instead of IF for the function).   The workbook functions are mostly the same -- except for using semicolons instead of commas to separate elements.&lt;br /&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/21667255-114140018187960810?l=basic1605.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://basic1605.blogspot.com/feeds/114140018187960810/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=21667255&amp;postID=114140018187960810' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/21667255/posts/default/114140018187960810'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/21667255/posts/default/114140018187960810'/><link rel='alternate' type='text/html' href='http://basic1605.blogspot.com/2006/03/sorting.html' title='sorting'/><author><name>Carol</name><uri>http://www.blogger.com/profile/18378658078131278144</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-21667255.post-113941365375250627</id><published>2006-02-08T07:44:00.000-08:00</published><updated>2006-02-08T07:47:33.763-08:00</updated><title type='text'>Changing controls in a dialog</title><content type='html'>&lt;span style="font-size:85%;"&gt;oControl = oDialog1.getControl("ComboBox1")&lt;br /&gt;msgbox oControl.itemcount&lt;br /&gt;msgbox oControl.text&lt;br /&gt;oControl = oDialog1.GetControl("Label1")&lt;br /&gt;msgbox oControl.text&lt;br /&gt;oControl.text = "kitty"&lt;br /&gt;oControl = oDialog1.GetControl("CheckBox1")&lt;br /&gt;msgbox oControl.state&lt;br /&gt;oDialog1Model = oDialog1.Model&lt;br /&gt;oControlModel = oDialog1Model.CheckBox1&lt;br /&gt;oControlModel.state = 1&lt;br /&gt;oControlModel.label = "hello"&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/21667255-113941365375250627?l=basic1605.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://basic1605.blogspot.com/feeds/113941365375250627/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=21667255&amp;postID=113941365375250627' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/21667255/posts/default/113941365375250627'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/21667255/posts/default/113941365375250627'/><link rel='alternate' type='text/html' href='http://basic1605.blogspot.com/2006/02/changing-controls-in-dialog.html' title='Changing controls in a dialog'/><author><name>Carol</name><uri>http://www.blogger.com/profile/18378658078131278144</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-21667255.post-113889656494532327</id><published>2006-02-02T08:00:00.000-08:00</published><updated>2006-02-02T08:12:40.406-08:00</updated><title type='text'>Range entries to listbox</title><content type='html'>Again, there's probably an easier way to do this, but this works to copy entries from a spreadsheet range to a listbox (or combobox) in a dialog.&lt;br /&gt;&lt;br /&gt;rngname="Jason"  'the name of the range (one column by unknown number of rows)&lt;br /&gt;oNamedRange = ThisComponent.NamedRanges.getByName(rngname)&lt;br /&gt;sName = oNamedRange.getContent()  'gives full address starting with $&lt;br /&gt;xPos = InStr(1,sName,".") - 2  'sheet name ends with .&lt;br /&gt;sName = Mid(sName,2,xPos)&lt;br /&gt;oSheet = ThisComponent.Sheets.getByName(sName)&lt;br /&gt;oRange = oSheet.getcellrangebyname(rngname)&lt;br /&gt;rtot=oRange.rows.count -1&lt;br /&gt;dim a(rtot)&lt;br /&gt;for j=0 to rtot&lt;br /&gt; oCell=oRange.getcellbyposition(0,j)&lt;br /&gt; a(j)=ocell.string&lt;br /&gt;next&lt;br /&gt;DialogLibraries.LoadLibrary( "Standard" )&lt;br /&gt;oDialog1 = CreateUnoDialog( DialogLibraries.Standard.Dialog1 )&lt;br /&gt;oControl = oDialog1.GetControl("ComboBox1")  'provided it already exists&lt;br /&gt;oControl.additems(a(),0)&lt;br /&gt;&lt;br /&gt;oDialog1.Execute()  'entries can be added afterwards also&lt;br /&gt;'but in a separate sub&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/21667255-113889656494532327?l=basic1605.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://basic1605.blogspot.com/feeds/113889656494532327/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=21667255&amp;postID=113889656494532327' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/21667255/posts/default/113889656494532327'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/21667255/posts/default/113889656494532327'/><link rel='alternate' type='text/html' href='http://basic1605.blogspot.com/2006/02/range-entries-to-listbox.html' title='Range entries to listbox'/><author><name>Carol</name><uri>http://www.blogger.com/profile/18378658078131278144</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-21667255.post-113873671116173290</id><published>2006-01-31T11:38:00.000-08:00</published><updated>2006-01-31T11:45:11.170-08:00</updated><title type='text'>Turn to sheet having range and select range</title><content type='html'>This is not the most elegant way of doing things, but it works for turning to the sheet containing "rngname" and then selecting the range.  It doesn't turn to the desired sheet until the last line.&lt;br /&gt;&lt;br /&gt;oDoc = ThisComponent&lt;br /&gt;oRanges = oDoc.NamedRanges&lt;br /&gt;oNamedRange = oRanges.getByName(rngname)&lt;br /&gt;oAddr = oNamedRange.getContent()&lt;br /&gt;xPos = InStr(1,oAddr,".")-2&lt;br /&gt;oAddr = Mid(oAddr,2,xPos)&lt;br /&gt;oCells = ThisComponent.Sheets.getByName(oAddr).getCellRangeByName(rngname)&lt;br /&gt;ThisComponent.getCurrentController.select(oCells)&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/21667255-113873671116173290?l=basic1605.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://basic1605.blogspot.com/feeds/113873671116173290/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=21667255&amp;postID=113873671116173290' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/21667255/posts/default/113873671116173290'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/21667255/posts/default/113873671116173290'/><link rel='alternate' type='text/html' href='http://basic1605.blogspot.com/2006/01/turn-to-sheet-having-range-and-select.html' title='Turn to sheet having range and select range'/><author><name>Carol</name><uri>http://www.blogger.com/profile/18378658078131278144</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-21667255.post-113872545748250914</id><published>2006-01-31T08:11:00.000-08:00</published><updated>2006-01-31T08:37:37.490-08:00</updated><title type='text'>Columns before rows</title><content type='html'>In cell addresses, the column position comes before the row position.  (Both start with 0.)  So, I hope these are right,&lt;br /&gt;oSheet.getCellByPosition(1,3)&lt;br /&gt;is equivalent to&lt;br /&gt;oSheet.getCellRangeByName("B4")&lt;br /&gt;To get ranges:&lt;br /&gt;oRange = ThisComponent.NamedRanges.getByName("Jason")&lt;br /&gt;oRange = oSheet.getCellRangeByPosition(0,0,1,3)&lt;br /&gt;oRange = oSheet.getCellRangeByName("a1:b3")&lt;br /&gt;These are equivalent, provided Jason is a1:b3.&lt;br /&gt;temp =  oCell.getSpreadSheet().getName&lt;br /&gt;temp2 = oCell.CellAddress.Column&lt;br /&gt;temp3 = oCell.CellAddress.Row&lt;br /&gt;get the name of the spreadsheet that oCell is on, the column number, and the row number.&lt;br /&gt;temp = oRange.getSpreadSheet().getName&lt;br /&gt;doesn't work.&lt;br /&gt;oSheet = oDoc.Sheets.getByName("Brian")&lt;br /&gt;oSheet = oDoc.Sheets.getByIndex(1)&lt;br /&gt;are equivalent, provided the 2nd sheet is named Brian.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/21667255-113872545748250914?l=basic1605.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://basic1605.blogspot.com/feeds/113872545748250914/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=21667255&amp;postID=113872545748250914' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/21667255/posts/default/113872545748250914'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/21667255/posts/default/113872545748250914'/><link rel='alternate' type='text/html' href='http://basic1605.blogspot.com/2006/01/columns-before-rows.html' title='Columns before rows'/><author><name>Carol</name><uri>http://www.blogger.com/profile/18378658078131278144</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-21667255.post-113855412821302092</id><published>2006-01-29T08:59:00.000-08:00</published><updated>2006-01-29T09:02:08.220-08:00</updated><title type='text'>Make global</title><content type='html'>Note to self:  Make dialog and listbox global in order not to lose them when subs end.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/21667255-113855412821302092?l=basic1605.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://basic1605.blogspot.com/feeds/113855412821302092/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=21667255&amp;postID=113855412821302092' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/21667255/posts/default/113855412821302092'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/21667255/posts/default/113855412821302092'/><link rel='alternate' type='text/html' href='http://basic1605.blogspot.com/2006/01/make-global.html' title='Make global'/><author><name>Carol</name><uri>http://www.blogger.com/profile/18378658078131278144</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry></feed>
