View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Jim Thomlinson Jim Thomlinson is offline
external usenet poster
 
Posts: 5,939
Default Weird Happenings

I see no difference between the 2 code samples you provided... Including the
typo on the word activate.

Post your entire code for the procedure. In the big picture there is really
no reason to ever (almost ever) select or activate anything. If we could see
your code we might be able to clean it up.
--
HTH...

Jim Thomlinson


" wrote:

I have an application with a bunch of dropdown controls and buttons
that run macros.

In a particular instance if i reset dropdown 1 to "New" it then sets
dropdown 2 to "New"

The issue is, that when the second dropdown2_change event runs a
different sheet in the workbook appears to be activated (though it
should not), on a closer look the sheet was not activated as the tab
for the original sheet is still selected, however now the 2nd sheets
information is displayed. But if i then click a different tab and
then click back everything looks normal (so the data did not get
written over)

Hopefully this example clears it up:

Adding the following code to the dropdown2_change fixes the issue but
its sloppy sloppy programming

Sub dropdown2_change()
'code happens
sheets("anothersheetinworkbook").activate
sheets("mainsheet").actiavte
End Sub

This is the one that produces the weird thing:

Sub dropdown2_change()
'code happens
sheets("anothersheetinworkbook").activate
sheets("mainsheet").actiavte
End Sub

Any ideas?