View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Tom Ogilvy Tom Ogilvy is offline
external usenet poster
 
Posts: 27,285
Default Macro: Row transposing; event on open vs. shortcut key

Depends on where you put it. If in a sheet module, then the code operates
differently there than if it were in a general module. This could be true
if you put it in the Thisworkbook module as well. Why not put the code in a
general module and have you onopen event just call it.

--
Regards,
Tom Ogilvy

"Eric Schneider" wrote in message
om...
I have a macro that formats data from one sheet and places it into
another. I assigned the a shortcut key. When I execute the shortcut
key everything works great.

However, when I put the same Sub in the OnOpen event of the Excel
workbook (to save users the trouble of having to execute this macro
manually everytime they open the file) it DOESN'T work. Rather
several of the columns are transposed and the row mapping from one
sheet to the other isn't exact either.

I'm at a loss. If the exact same code is being executed it should
either work by shortcut key AND OnOpen event...or else neither of them
should work.

Is this a known Excel bug of some type?

Any comments appreciated...
Thanks,
Eric