excel - Cell content is moved automatically to same cell on another sheet -


there's bug or error in code or workbook somewhere can't seem find or understand why happening.

what's happening there's userform has button :

  1. select cell sheet2
  2. put selected cell value in sheet1 cell b10 dropdown menu
  3. unloads form return sheet1 , select cell described in code sheet1.b26 .

now form gone. if click in sheet1.b26 selected cell , write press {tab} content cell transferred exact same cell on sheet2 automatically , sheet1.b26 cell empty .

this happens once if start writing in selected cell when form gone.

there no code/formula in worksheet or workbook or module should describes action.

this bugging me week couldn't find solution anywhere.

workbook if wish download , try it.

video description of error

to recreate this:

  1. go sheet1
  2. fire form using first button on sheet1 has "klant zoek" text on it.
  3. press button "selecteer" on form.
  4. without selecting other cell enter in last selected cell macro , press tab.

p.s. - didn't write of code in workbook assigned debug it.

the problem described in question can reproduced in excel 2013, doesn't occur in earlier versions. did not have chance test in 2016. similar problem can found here , here.

there 3 parts common cases:

1) userform shown using form button or shape click event handler

2) userform modal (vbmodal default value of userform.show parameter)

3) userform code changes active sheet

as result, sheet activated userform shown, not active. edits made appear in (before userform shown) active sheet.

it bug in excel 2013, easiest workarounds solve are:

1) use activex button show form

2) show modeless form: userform1.show vbmodeless

but if cannot use activex , need modal form? this answer suggests hiding , showing activewindow, did not work me.

the workaround show modal form without activex working me is:

to show modal userform1, create empty userform2 activate event handler:

private sub userform_activate()   'hide form   me.left = -1000   'show target form    userform1.show   unload me end sub 

and instead of:

userform1.show 

use:

userform2.show vbmodeless  

Comments

Popular posts from this blog

wordpress - (T_ENDFOREACH) php error -

Export Excel workseet into txt file using vba - (text and numbers with formulas) -

Using django-mptt to get only the categories that have items -