VBA-Excel Place blinking cursor in selected cell -


this super easy, can't seem figure out.

when click on cell on sheet (single-click), want cursor in cell blinking (as if had double-clicked on cell)

i trying accomplish using application.sendkeys "{f2}"

i'm not sure how go coding identify selected/activecell in order use application.sendkeys "{f2}" ...if possible or efficient way it.

or better yet, there way call double-click event respond single-click on cell?

as always, input appreciated!

you may use worksheet_selectionchange event. place below code in sheet. below code highlight active cell yellow color on navigation.

private sub worksheet_selectionchange(byval target range)      application.enableevents = false     on error resume next      cells.interior.pattern = xlnone     activecell.interior.color = vbyellow      application.enableevents = true  end sub 

alternatively may consider below

private sub worksheet_beforedoubleclick(byval target range, cancel boolean)         application.enableevents = false     on error resume next       cells.interior.pattern = xlnone     activecell.interior.color = vbyellow      application.enableevents = true  end sub 

Comments

Popular posts from this blog

python - How to create a legend for 3D bar in matplotlib? -

java - Multi-Label Document Classification -

php - Dynamic url re-writing using htaccess -