View Single Post
  #8   Report Post  
Posted to microsoft.public.excel.programming
Harald Staff Harald Staff is offline
external usenet poster
 
Posts: 1,327
Default Get / Extract Data from an Excel Field

"Oener" skrev i melding
...

If I don't want to mention the name of my worksheet I use "Me." instead of
"ThisWorkbook.Sheets(1).".

But how do I do that for a button instead of for the sheet?


As I said, use buttons from the Forms toolbar. Commandbuttons can't do what
you want as far as I know.

If you insist on writing awkward but still lazy code; create a macro that
use a "for i = 1 to 500" loop and write the same code 500 times to a
textfile, incrementing only the button number, possibly also the cell
address. Then paste that text into the VB editor.

What you should do, using one solution or another, is to have a single
"generate email" code and pass the recipient address to it from your click
macro(s). 500+ items of what you already have may be too big for a module,
it's a huge waste of space and impossible to do maintenance on.

HTH. Best wishes Harald