Help with a pop-up msg

F

flds

I need some help in Excel for a macro.

A1 Column Heading
A2 Negative value (-2)
A3 Sub total (-2) (Cell locked with formula)
A4 I have a positive value (6)
A5 Sub total (4) (Cell locked with formula)
A6 I have a positive value (10)
A7 Sub total (14) (Cell locked with formula)
A8 Empty (waiting for value)

In A8 when I enter a value > 1, I need a pop-up message "THIRD WEEK"
only if A4 and A6 is with positive values. If either A4 or A6 has a
negative value the message should not pop-up.

(if possible the message to read "THIRD WEEK + the heading of the
column" would be prefered)

The chart has a range of A4:F313. The pop-up msg could pop anywhere
within the range, if the above scenario occurs.

I hope I am clear in the above explanation
Your help in creating a macro would be appreciated.

Thanks

FLDS
 
D

Don Guillett

This works for your example. It is not clear if you want it to work for all
columns???

Right click sheet tab>view code>insert this.
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Address <> Range("a8").Address Then Exit Sub
If Target > 0 And Range("a4") > 0 And Range("a6") > 0 Then
MsgBox "Third week " & Range("a1")
End If
End Sub
 
F

flds

This works for your example. It is not clear if you want it to work for all
columns???

Right click sheet tab>view code>insert this.
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Address <> Range("a8").Address Then Exit Sub
If Target > 0 And Range("a4") > 0 And Range("a6") > 0 Then
MsgBox "Third week " & Range("a1")
End If
End Sub

--
Don Guillett
Microsoft MVP Excel
SalesAid Software










- Show quoted text -




Hi Don,

Thanks for your reply and code.

Yes I want this to work for all columns, I have mentioned the range
and this can occur any where within the range (The chart has a range
of A4:F313).

I would appreciate if this will work for me.

Thanks once again.

FLDS
 
D

Don Guillett

I prefer TOP posting so when replying to me post at the TOP.
I'm still not positive of what you want since you mention a lot of rows but
this works for row 8 for columns a:f. If not, send your file to me with a
clear explanation.

Private Sub Worksheet_Change(ByVal Target As Range)
If Intersect(Target, Range("a8:f8")) Is Nothing Then Exit Sub
If Target > 0 And Target.Offset(-4) > 0 And Target.Offset(-2) > 0 Then
MsgBox "Third week " & Target.Offset(-7)
End If
End Sub

--
Don Guillett
Microsoft MVP Excel
SalesAid Software
(e-mail address removed)
This works for your example. It is not clear if you want it to work for
all
columns???

Right click sheet tab>view code>insert this.
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Address <> Range("a8").Address Then Exit Sub
If Target > 0 And Range("a4") > 0 And Range("a6") > 0 Then
MsgBox "Third week " & Range("a1")
End If
End Sub

--
Don Guillett
Microsoft MVP Excel
SalesAid Software










- Show quoted text -




Hi Don,

Thanks for your reply and code.

Yes I want this to work for all columns, I have mentioned the range
and this can occur any where within the range (The chart has a range
of A4:F313).

I would appreciate if this will work for me.

Thanks once again.

FLDS
 
F

flds

I prefer TOP posting so when replying to me post at the TOP.
I'm still not positive of what you want since you mention a lot of rows but
this works for row 8 for columns a:f. If not, send your file to me with a
clear explanation.

Private Sub Worksheet_Change(ByVal Target As Range)
If Intersect(Target, Range("a8:f8")) Is Nothing Then Exit Sub
If Target > 0 And Target.Offset(-4) > 0 And Target.Offset(-2) > 0 Then
MsgBox "Third week " & Target.Offset(-7)
End If
End Sub

--
Don Guillett
Microsoft MVP Excel
SalesAid Software






Hi Don,

Thanks for your reply and code.

Yes I want this to work for all columns, I have mentioned the range
and this can occur any where within the range (The chart has a range
of A4:F313).

I would appreciate if this will work for me.

Thanks once again.

FLDS- Hide quoted text -

- Show quoted text -



Thanks Don

The only problem is the heading. It should not be offset (-7)

It is constantly the same column on row 3

FLDS
 
D

Don Guillett

If not, send your file to me with a
clear explanation.


--
Don Guillett
Microsoft MVP Excel
SalesAid Software
(e-mail address removed)
I prefer TOP posting so when replying to me post at the TOP.
I'm still not positive of what you want since you mention a lot of rows
but
this works for row 8 for columns a:f. If not, send your file to me with a
clear explanation.

Private Sub Worksheet_Change(ByVal Target As Range)
If Intersect(Target, Range("a8:f8")) Is Nothing Then Exit Sub
If Target > 0 And Target.Offset(-4) > 0 And Target.Offset(-2) > 0 Then
MsgBox "Third week " & Target.Offset(-7)
End If
End Sub

--
Don Guillett
Microsoft MVP Excel
SalesAid Software






Hi Don,

Thanks for your reply and code.

Yes I want this to work for all columns, I have mentioned the range
and this can occur any where within the range (The chart has a range
of A4:F313).

I would appreciate if this will work for me.

Thanks once again.

FLDS- Hide quoted text -

- Show quoted text -



Thanks Don

The only problem is the heading. It should not be offset (-7)

It is constantly the same column on row 3

FLDS
 

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