VBA script in Excel 2004

A

a_puny_human

Version: 2004 Operating System: Mac OS X 10.5 (Leopard) Processor: Power PC Hi,

I'm trying to get a VBA script to run automatically on a cell change, while the code works fine on a PC, the Mac won't do take any action the code* is as follows:

Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Address = "$E$5" Then
If Range("E5").Value = "Red" Then
Range("C15").Value = "Stop"
End If
If Range("E5").Value = "Green" Then
Range("C15").Value = "Go"
End If
End If
End Sub

"Green" and "Red" are options in a drop down list. Macros are enabled and I've closed and reopened the file before i tried it.

Any suggestions to get this to work would be greatly appreciated.

Thanks!

aph

This is my test code to get any result, not the practical code that i intend to implement. Getting a result though, would be a nice step forward.
 
B

Bob Greenblatt

Version: 2004 Operating System: Mac OS X 10.5 (Leopard) Processor: Power
PC Hi,

I'm trying to get a VBA script to run automatically on a cell change,
while the code works fine on a PC, the Mac won't do take any action the
code* is as follows:

Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Address = "$E$5" Then
If Range("E5").Value = "Red" Then
Range("C15").Value = "Stop"
End If
If Range("E5").Value = "Green" Then
Range("C15").Value = "Go"
End If
End If
End Sub

"Green" and "Red" are options in a drop down list. Macros are enabled
and I've closed and reopened the file before i tried it.

Any suggestions to get this to work would be greatly appreciated.

Thanks!

aph

# This is my test code to get any result, not the practical code that i
intend to implement. Getting a result though, would be a nice step forward.
The problem is that the worksheet change event does not fire when a
cell's content changes as a result of selecting data from a data
validation list.
 
A

a_puny_human

Hi Bob.

Thanks for the quick reply.

OK - no drop down lists. but even if i ax the list and manually input the value, i still don't get a result. Any thoughts?

Thanks,

aph
 
B

Bob Greenblatt

Hi Bob.

Thanks for the quick reply.

OK - no drop down lists. but even if i ax the list and manually input
the value, i still don't get a result. Any thoughts?

Thanks,

aph
Is the code on the worksheet's code module? Is calculation set to automatic?
 
A

a_puny_human

the code is on the worksheets' code module.

i'm not sure if the calculation is set to automatic, how would i check/correct that?

-
aph
 
J

Jim Gordon Mac MVP

the code is on the worksheets' code module.

i'm not sure if the calculation is set to automatic, how would i
check/correct that?

-
aph

Hi,

Use Excel > Preferences > Calculation and see if the Automatic option is
selected.

-Jim
 
A

a_puny_human

Yup it was checked off as automatic.

I think i'm willing to relegate it to my own fumbling coding. Since yesterday, I've found a different way of getting the result that i wantedand it seems to work and to work automatically.

Cheers,

aph.
 

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