View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
Don Guillett Don Guillett is offline
external usenet poster
 
Posts: 10,124
Default Too many gotoos?

when you say goto's perhaps you mean

sheets("sheet1").select
range("a1").select
selection=1
or this which is better
appliation.goto sheets("sheet1").range("a1")

but this avoids all selections.

sheets("sheet1").range("a1").value=1

--
Don Guillett
SalesAid Software

"davegb" wrote in message
oups.com...
The following code creates a spreadsheet by getting user input on the
"Facility Name" and the number of clients that facility served during
the month. The user fills in the blank fields after filling out the
form. The macro creates the nearly blank rows for the data and a row of
subtototals. When the user clicks "Cancel", the macro puts in a row of
Overall Totals at the bottom. It works fine. But it uses 3 Goto
commands (it had 5 before I cleaned it up a bit) and I understand gotos
are no-nos for good coding. I'm interested in feedback to see if
there's a way to use less of them. Two of the three are for error
handling in case the user failed to enter both required pieces of data.


I'm also interested in any other input on my coding. Thanks to anyone
who gives me feedback, and even more thanks if you think I did
something right! :)