Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 17
Default run a marco automatically

i need a marco runs automatically after a selection in page area (i wonder
if it is called page area). is it possible? how to write the code?

example:
there are mutiple shops sales data in a pivot table. i want the marco to run
automatically after i select a different shop. since there are 2 tables in
one sheet. i need to merge 2 tables after selecting a different shop?

please help!

Dennis


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 137
Default run a marco automatically

Dennis,

Have you sorted out your "custom sort" ?

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 17
Default run a marco automatically

thanks Carim! it all works. really appreciate for your kind assistance.

"Carim" wrote in message
oups.com...
Dennis,

Have you sorted out your "custom sort" ?



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 18
Default run a marco automatically

Hi Dennis,
The solution provided by Carim is appropriate for yor problem.
To run marco automatically after a selection:

Call the macro in "Worksheet_SelectionChange" event.

Here even you can restrict the macro call to particular range by
checking the Target parameter of event.

Regards.

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 17
Default run a marco automatically

Dear Vinit,

Since I am not familar to VBA. Can you explain more specific?
The selection is in range b2 and the marco name is marco1.

Dennis

"Vinit" wrote in message
oups.com...
Hi Dennis,
The solution provided by Carim is appropriate for yor problem.
To run marco automatically after a selection:

Call the macro in "Worksheet_SelectionChange" event.

Here even you can restrict the macro call to particular range by
checking the Target parameter of event.

Regards.





  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 18
Default run a marco automatically

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Target.Column = 2 and Target.Row= 2 Then 'For B2
ShowCellValue' macro1
End If
End Sub

Sub ShowCellValue() 'My Macro. macro1 in ur case
MsgBox "The value =" & ActiveCell.Value
End Sub

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Marco Puzzled Excel Discussion (Misc queries) 3 July 30th 07 05:09 PM
Marco Help looper Excel Discussion (Misc queries) 2 May 12th 07 06:55 PM
Marco Loi New Users to Excel 4 December 7th 04 08:52 PM
Can it be done by marco? kaon[_5_] Excel Programming 1 June 28th 04 10:56 AM
marco David Kuehl Excel Programming 4 September 18th 03 11:37 PM


All times are GMT +1. The time now is 05:21 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"