ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   How do i call a macro from a cell (https://www.excelbanter.com/excel-programming/365261-how-do-i-call-macro-cell.html)

KhanhNguyen

How do i call a macro from a cell
 

I have a problem
The "A3" cell 's formula contain "A1" and "A2"
I want to do this work " when the value of cell "A1" change, excel
automatically GoalSeek cell "A3" to the goal:=100 by changing cell "A2"
"
That mean the value of cell "A3" always is 100 whatever cell "A1" 's
value is
Please help me !


--
KhanhNguyen
------------------------------------------------------------------------
KhanhNguyen's Profile: http://www.excelforum.com/member.php...o&userid=33697
View this thread: http://www.excelforum.com/showthread...hreadid=555197


ADG

How do i call a macro from a cell
 
hI

Try using the worksheet change event to trigger the solver

Private Sub Worksheet_Change(ByVal Target As Range)
If Target = Range("A1") Then
... Record the solver macro and paste in here
End If
End Sub

Regards

ADG
--
Tony Green


"KhanhNguyen" wrote:


I have a problem
The "A3" cell 's formula contain "A1" and "A2"
I want to do this work " when the value of cell "A1" change, excel
automatically GoalSeek cell "A3" to the goal:=100 by changing cell "A2"
"
That mean the value of cell "A3" always is 100 whatever cell "A1" 's
value is
Please help me !


--
KhanhNguyen
------------------------------------------------------------------------
KhanhNguyen's Profile: http://www.excelforum.com/member.php...o&userid=33697
View this thread: http://www.excelforum.com/showthread...hreadid=555197




All times are GMT +1. The time now is 03:45 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com