application.goto

T

Tami

hi.

i have a macro that inserts a line for the user. then the user has to go to
column AC to enter a number.

so i'd like the insert macro to end with logic that puts the cursor where it
needs to be.

i tried

Application.Goto Reference:=Worksheets("Assortment").Cells(lr, "ac")

(lr is defined as the row my cursor was on when i started the macro which
lets assume the value is 46)



it works great in that my "cursor" is on cell AC46 but its not in my view.
i can see its "selected" and sitting on AC46 in the upper left corner but
again the screen didn't move me there so the user can do what they need to do.



i tried scroll=left at the end of the sentence but it moved ac46 to the
upper left corner of my screen which is a little confusing. It’s as if i
just want to scroll left or right to get the cell into view.



thanks in advance for any and all help

Tami
 
D

Don Guillett

I just tested this
Sub gothere()
lr = ActiveCell.Row
Application.Goto Reference:=Worksheets("sheet14").Cells(lr, "ac")
End Sub
 
T

Tami

yep, it works and i can see my cursor on cell(lr,"ac").
But if i start with my cursur/screen in columns BF for example (somewhere
off to the far right), it doesn't bring the cell into view...does that make
sense?
 
E

excelent

Application.Goto Reference:=Worksheets("sheet14").Cells(lr, "ac"),scroll:=true


"Tami" skrev:
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top