How to return the cursor back to original cell

  • Thread starter Frank Situmorang
  • Start date
F

Frank Situmorang

Hello,

I have created a data bank using a kind of filter. At the top row I have a
button of macro for hiding and unhiding columns.

My question is what VBA should I put in order to put the cursor back
automatically jump back to original cell. To be more clear, following the
sample:

Macro button
a b c d e
1
2
3
4 original cursor here, after filtered

I want the cursor back to original when pressing button,

We appreciate for any idea.

Thanks in advance

Frank


2
2
 
E

excelent

First in macro:
org = ActiveCell.Address
Last in Macro:
Range(org).Select



"Frank Situmorang" skrev:
 
F

Frank Situmorang

It is not clear to me excellent, are y saying in the first row of the macro
we type:
org = ActiveCell.Address
and in the last row we type:
Range(org).Select

I appreciate if you could elaborate it again,

Thanks,

Frank
 
E

excelent

ok Frank, maby i didnt get it right
try explain again


"Frank Situmorang" skrev:
 
F

Frank Situmorang

Ok here is my problem:

By the help of this forum I can create a kind of a databank of the actual
price list taken from all puchase order lines.

If Iwant to see a certain materials/good, I just type *valve* for example
all material with word"valve wil be filtered. Since my worksheet has many
colums while I am only interested in certain columns I make a macro at the
top of the page.

To look for for certain valve price list I put mu cursor on it, but some
times I want to undhide the specs's column, then I click macro button at the
top, but I want it back again to the original where I pointed the cell,
otherwise to go back to that cell manually takes time.
Can you tell me what vba should I make?

Thanks in advance.

Frank
 
E

excelent

org = ActiveCell.Address variable "org" is saving celladdress when u
actvate macro

Range(org).Select is returning to celladdress savd in variable "org"

so put theese 2 lines in the macro u start when the curser is in the cell u
wana return to


"Frank Situmorang" skrev:
 
F

Frank Situmorang

Thanks a lot excellent, it's wonderful..

Frank

excelent said:
org = ActiveCell.Address variable "org" is saving celladdress when u
actvate macro

Range(org).Select is returning to celladdress savd in variable "org"

so put theese 2 lines in the macro u start when the curser is in the cell u
wana return to


"Frank Situmorang" skrev:
 
J

John Shelton

Try this that Joel sent to me a couple of days ago.

Dim strPlace as String

Set strPlace = ActiveCell 'place at the beginning of Sub()

strPlace.Select ' place when you want to go back like at the end of
Sub()

John
 

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