• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

Event Driven Macro

Manan

New Member
Hi Freinds,

I am planning to code a macro which will have below functionality. Say we have Two Columns . Column A is Inventory Column where i have list of my inventory item. Like below

Inventory--- Column A Column B
Gxs181765--- Row1 Gxs181765
Gbb213455---Row2
Ust234897--- Row3
Pbf7658901--- ROw4

My objective is when i click Row 1 of Inventory the Column B is filled with Row1 Value , When Click Row 2 then Row Column B is filled with Row2 Value and so on . This i require so that further automated operations can be performed based on ColumnB values. As i have lot of values under the Inventory Column so everytime copy&paste the desired value is too annoying and so looking for some event driven where i click on a cell and it's value gets populated in Column B. I highly appreciate any help on this by you guys.
 
Hi Manan ,

Please upload a sample file with some data.

Also , should the code carry out the action all the time or only as long as column B is blank ? If it is all the time , then every time any row in column A is clicked , the contents of column B will be overwritten.

Narayan
 
Hi Narayan,

Due to Some reason i am not able to download it , but the sample is like Take two Cols COl A and Col B. Col A contains the entries
Gxs181765
Gbb213455
Ust234897
Pbf7658901.

If i click on first cell then Col B should contain First Cell Entry i.e. Gxs181765 and if i click on Second Cell Col B entry then overwritten by Gbb213455. So your assumption is correct that "
every time any row in column A is clicked , the contents of column B will be overwritten."

Manan.
 
Hi Manan ,

Does this mean that in column B only one cell will be used to reflect the cell in column A which was clicked ?

Narayan
 
yes , Narayan , u r correct , Col B will have only one Cell that will contain the value of COL A Active clicked Cell
 
Hi Manan ,

See if this is OK.

I have used the DoubleClick event , not the single click. There is no single click event , though this is the same as a SelectionChange ; however , if you use the SelectionChange event , it will be acted upon even when you move the cursor from cell to cell using the cursor movement keys. Is this acceptable ?

Narayan
 

Attachments

  • Book2.xlsm
    13 KB · Views: 3
Back
Top