Run a Macro when value is...
Closed
cprevoisin
Posts
3
Registration date
Thursday September 5, 2013
Status
Member
Last seen
September 6, 2013
-
Sep 5, 2013 at 03:11 PM
Blocked Profile - Sep 6, 2013 at 07:30 PM
Blocked Profile - Sep 6, 2013 at 07:30 PM
Related:
- Run a Macro when value is...
- Spell number in excel without macro - Guide
- Excel macro to create new sheet based on value in cells - Guide
- Macro excel download - Download - Spreadsheets
- Run macro on opening workbook - Guide
- Run macro when cell value changes - Guide
3 responses
Good Afternoon,
Insert this when the workbook sheet is changed:
Private Sub Workbook_SheetChange(ByVal Sh As Object, ByVal Target As Range)
Dim valueX
valueX = Sheet1.Range("A4")
If valueX = "4" Then
MsgBox ("your macro a here")
Else
MsgBox ("your macro b here")
End If
End Sub
Have Fun!
Insert this when the workbook sheet is changed:
Private Sub Workbook_SheetChange(ByVal Sh As Object, ByVal Target As Range)
Dim valueX
valueX = Sheet1.Range("A4")
If valueX = "4" Then
MsgBox ("your macro a here")
Else
MsgBox ("your macro b here")
End If
End Sub
Have Fun!
cprevoisin
Posts
3
Registration date
Thursday September 5, 2013
Status
Member
Last seen
September 6, 2013
Sep 5, 2013 at 08:05 PM
Sep 5, 2013 at 08:05 PM
Thank you very much! But I still have a problem. The macro wont run...?! Do I need to make something else so it knows the value in the cell changed?
Also, is it possible to do this?
Private Sub Workbook_SheetChange(ByVal Sh As Object, ByVal Target As Range)
Dim valueX
valueX = Sheet1.Range(AQ4)
If valueX = "4" Then
MsgBox (AlturaA)
Else
Dim valueX
valueX = Sheet1.Range(AQ4)
If valueX = "6" Then
MsgBox (AlturaB)
End If
This is because I need the Macros to work with the two different values...
Thank you very much for your help!
Also, is it possible to do this?
Private Sub Workbook_SheetChange(ByVal Sh As Object, ByVal Target As Range)
Dim valueX
valueX = Sheet1.Range(AQ4)
If valueX = "4" Then
MsgBox (AlturaA)
Else
Dim valueX
valueX = Sheet1.Range(AQ4)
If valueX = "6" Then
MsgBox (AlturaB)
End If
This is because I need the Macros to work with the two different values...
Thank you very much for your help!
cprevoisin
Posts
3
Registration date
Thursday September 5, 2013
Status
Member
Last seen
September 6, 2013
Sep 6, 2013 at 04:43 PM
Sep 6, 2013 at 04:43 PM
How do i save it that way? It doesn't gives me an option.:(