#1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 468
Default Popup macro

Hi, can this be modified......

Private Sub Worksheet_Change(ByVal Target As Excel.Range)
If Target.Address = "$B$2" And UCase(Target.Value) = "Jim" Then
MsgBox "Free time", vbExclamation, ""
Range("C2").Activate
End If
End Sub

To something like this......?

Private Sub Worksheet_Change(ByVal Target As Excel.Range)
If Target.Address = "sheet1!B2:B10" And UCase(Target.Value) =
"sheet2!F2:F10" Then
MsgBox "Free time", vbExclamation, ""
Range("C2").Activate
End If
End Sub

Thanks!
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 8,520
Default Popup macro

Try the below. Right click Active sheet tabView Code and paste the below code

Private Sub Worksheet_Change(ByVal Target As Excel.Range)
If Not Application.Intersect(Target, Range("B2:B10")) Is Nothing Then
If Target.Value = Worksheets("Sheet2").Range("F" & Target.Row) Then
MsgBox "Free time", vbExclamation, ""
Range("C" & Target.Row).Activate
End If
End If
End Sub

If this post helps click Yes
---------------
Jacob Skaria


"puiuluipui" wrote:

Hi, can this be modified......

Private Sub Worksheet_Change(ByVal Target As Excel.Range)
If Target.Address = "$B$2" And UCase(Target.Value) = "Jim" Then
MsgBox "Free time", vbExclamation, ""
Range("C2").Activate
End If
End Sub

To something like this......?

Private Sub Worksheet_Change(ByVal Target As Excel.Range)
If Target.Address = "sheet1!B2:B10" And UCase(Target.Value) =
"sheet2!F2:F10" Then
MsgBox "Free time", vbExclamation, ""
Range("C2").Activate
End If
End Sub

Thanks!

  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 468
Default Popup macro

Hi Jacob, it's working, but if i have Jim in F2, then in sheet 1 the macro
display message only in B2. I need to have Jim in one cell in F column and if
in B2:B10 i have 10 entries with Jim, then the message to popup each time Jim
appear in this range.
In F column i will probably have 2 or 3 names, so i need to write this names
only one time and in B range the message to appear each time a name from F
range is written.

Thanks!

"Jacob Skaria" a scris:

Try the below. Right click Active sheet tabView Code and paste the below code

Private Sub Worksheet_Change(ByVal Target As Excel.Range)
If Not Application.Intersect(Target, Range("B2:B10")) Is Nothing Then
If Target.Value = Worksheets("Sheet2").Range("F" & Target.Row) Then
MsgBox "Free time", vbExclamation, ""
Range("C" & Target.Row).Activate
End If
End If
End Sub

If this post helps click Yes
---------------
Jacob Skaria


"puiuluipui" wrote:

Hi, can this be modified......

Private Sub Worksheet_Change(ByVal Target As Excel.Range)
If Target.Address = "$B$2" And UCase(Target.Value) = "Jim" Then
MsgBox "Free time", vbExclamation, ""
Range("C2").Activate
End If
End Sub

To something like this......?

Private Sub Worksheet_Change(ByVal Target As Excel.Range)
If Target.Address = "sheet1!B2:B10" And UCase(Target.Value) =
"sheet2!F2:F10" Then
MsgBox "Free time", vbExclamation, ""
Range("C2").Activate
End If
End Sub

Thanks!

  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 8,520
Default Popup macro

I would have probably misread your query. Try the below..

Private Sub Worksheet_Change(ByVal Target As Excel.Range)
If Not Application.Intersect(Target, Range("B2:B10")) Is Nothing Then
If WorksheetFunction.CountIf(Worksheets("Sheet2").Ran ge("F2:F10"), _
Target.Value) 0 Then
MsgBox "Free time", vbExclamation, ""
Range("C" & Target.Row).Activate
End If
End If
End Sub

If this post helps click Yes
---------------
Jacob Skaria


"puiuluipui" wrote:

Hi Jacob, it's working, but if i have Jim in F2, then in sheet 1 the macro
display message only in B2. I need to have Jim in one cell in F column and if
in B2:B10 i have 10 entries with Jim, then the message to popup each time Jim
appear in this range.
In F column i will probably have 2 or 3 names, so i need to write this names
only one time and in B range the message to appear each time a name from F
range is written.

Thanks!

"Jacob Skaria" a scris:

Try the below. Right click Active sheet tabView Code and paste the below code

Private Sub Worksheet_Change(ByVal Target As Excel.Range)
If Not Application.Intersect(Target, Range("B2:B10")) Is Nothing Then
If Target.Value = Worksheets("Sheet2").Range("F" & Target.Row) Then
MsgBox "Free time", vbExclamation, ""
Range("C" & Target.Row).Activate
End If
End If
End Sub

If this post helps click Yes
---------------
Jacob Skaria


"puiuluipui" wrote:

Hi, can this be modified......

Private Sub Worksheet_Change(ByVal Target As Excel.Range)
If Target.Address = "$B$2" And UCase(Target.Value) = "Jim" Then
MsgBox "Free time", vbExclamation, ""
Range("C2").Activate
End If
End Sub

To something like this......?

Private Sub Worksheet_Change(ByVal Target As Excel.Range)
If Target.Address = "sheet1!B2:B10" And UCase(Target.Value) =
"sheet2!F2:F10" Then
MsgBox "Free time", vbExclamation, ""
Range("C2").Activate
End If
End Sub

Thanks!

  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 468
Default Popup macro

Hi Jacob. It was my fault. i didn't explain better :). it's working now. I
need one more change if possible. I need the macro to work with cells that
begin with one word, but may have 2 or more. i need in F to write Jim, and in
B, the macro to popup even in cell is something like Jim Brown. If it begin
with Jim, then the macro to display message.
Can this be done?
Thanks!

"Jacob Skaria" a scris:

I would have probably misread your query. Try the below..

Private Sub Worksheet_Change(ByVal Target As Excel.Range)
If Not Application.Intersect(Target, Range("B2:B10")) Is Nothing Then
If WorksheetFunction.CountIf(Worksheets("Sheet2").Ran ge("F2:F10"), _
Target.Value) 0 Then
MsgBox "Free time", vbExclamation, ""
Range("C" & Target.Row).Activate
End If
End If
End Sub

If this post helps click Yes
---------------
Jacob Skaria


"puiuluipui" wrote:

Hi Jacob, it's working, but if i have Jim in F2, then in sheet 1 the macro
display message only in B2. I need to have Jim in one cell in F column and if
in B2:B10 i have 10 entries with Jim, then the message to popup each time Jim
appear in this range.
In F column i will probably have 2 or 3 names, so i need to write this names
only one time and in B range the message to appear each time a name from F
range is written.

Thanks!

"Jacob Skaria" a scris:

Try the below. Right click Active sheet tabView Code and paste the below code

Private Sub Worksheet_Change(ByVal Target As Excel.Range)
If Not Application.Intersect(Target, Range("B2:B10")) Is Nothing Then
If Target.Value = Worksheets("Sheet2").Range("F" & Target.Row) Then
MsgBox "Free time", vbExclamation, ""
Range("C" & Target.Row).Activate
End If
End If
End Sub

If this post helps click Yes
---------------
Jacob Skaria


"puiuluipui" wrote:

Hi, can this be modified......

Private Sub Worksheet_Change(ByVal Target As Excel.Range)
If Target.Address = "$B$2" And UCase(Target.Value) = "Jim" Then
MsgBox "Free time", vbExclamation, ""
Range("C2").Activate
End If
End Sub

To something like this......?

Private Sub Worksheet_Change(ByVal Target As Excel.Range)
If Target.Address = "sheet1!B2:B10" And UCase(Target.Value) =
"sheet2!F2:F10" Then
MsgBox "Free time", vbExclamation, ""
Range("C2").Activate
End If
End Sub

Thanks!



  #6   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 8,520
Default Popup macro

Modified to suit your requirement

Private Sub Worksheet_Change(ByVal Target As Excel.Range)
If Not Application.Intersect(Target, Range("B2:B10")) Is Nothing Then
If WorksheetFunction.CountIf(Worksheets("Sheet2").Ran ge("F2:F10"), _
Split(Target.Value)(0)) 0 Then
MsgBox "Free time", vbExclamation, ""
Range("C" & Target.Row).Activate
End If
End If
End Sub

If this post helps click Yes
---------------
Jacob Skaria


"puiuluipui" wrote:

Hi Jacob. It was my fault. i didn't explain better :). it's working now. I
need one more change if possible. I need the macro to work with cells that
begin with one word, but may have 2 or more. i need in F to write Jim, and in
B, the macro to popup even in cell is something like Jim Brown. If it begin
with Jim, then the macro to display message.
Can this be done?
Thanks!

"Jacob Skaria" a scris:

I would have probably misread your query. Try the below..

Private Sub Worksheet_Change(ByVal Target As Excel.Range)
If Not Application.Intersect(Target, Range("B2:B10")) Is Nothing Then
If WorksheetFunction.CountIf(Worksheets("Sheet2").Ran ge("F2:F10"), _
Target.Value) 0 Then
MsgBox "Free time", vbExclamation, ""
Range("C" & Target.Row).Activate
End If
End If
End Sub

If this post helps click Yes
---------------
Jacob Skaria


"puiuluipui" wrote:

Hi Jacob, it's working, but if i have Jim in F2, then in sheet 1 the macro
display message only in B2. I need to have Jim in one cell in F column and if
in B2:B10 i have 10 entries with Jim, then the message to popup each time Jim
appear in this range.
In F column i will probably have 2 or 3 names, so i need to write this names
only one time and in B range the message to appear each time a name from F
range is written.

Thanks!

"Jacob Skaria" a scris:

Try the below. Right click Active sheet tabView Code and paste the below code

Private Sub Worksheet_Change(ByVal Target As Excel.Range)
If Not Application.Intersect(Target, Range("B2:B10")) Is Nothing Then
If Target.Value = Worksheets("Sheet2").Range("F" & Target.Row) Then
MsgBox "Free time", vbExclamation, ""
Range("C" & Target.Row).Activate
End If
End If
End Sub

If this post helps click Yes
---------------
Jacob Skaria


"puiuluipui" wrote:

Hi, can this be modified......

Private Sub Worksheet_Change(ByVal Target As Excel.Range)
If Target.Address = "$B$2" And UCase(Target.Value) = "Jim" Then
MsgBox "Free time", vbExclamation, ""
Range("C2").Activate
End If
End Sub

To something like this......?

Private Sub Worksheet_Change(ByVal Target As Excel.Range)
If Target.Address = "sheet1!B2:B10" And UCase(Target.Value) =
"sheet2!F2:F10" Then
MsgBox "Free time", vbExclamation, ""
Range("C2").Activate
End If
End Sub

Thanks!

  #7   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 468
Default Popup macro

You are the best!
Thanks allot!

"Jacob Skaria" a scris:

Modified to suit your requirement

Private Sub Worksheet_Change(ByVal Target As Excel.Range)
If Not Application.Intersect(Target, Range("B2:B10")) Is Nothing Then
If WorksheetFunction.CountIf(Worksheets("Sheet2").Ran ge("F2:F10"), _
Split(Target.Value)(0)) 0 Then
MsgBox "Free time", vbExclamation, ""
Range("C" & Target.Row).Activate
End If
End If
End Sub

If this post helps click Yes
---------------
Jacob Skaria


"puiuluipui" wrote:

Hi Jacob. It was my fault. i didn't explain better :). it's working now. I
need one more change if possible. I need the macro to work with cells that
begin with one word, but may have 2 or more. i need in F to write Jim, and in
B, the macro to popup even in cell is something like Jim Brown. If it begin
with Jim, then the macro to display message.
Can this be done?
Thanks!

"Jacob Skaria" a scris:

I would have probably misread your query. Try the below..

Private Sub Worksheet_Change(ByVal Target As Excel.Range)
If Not Application.Intersect(Target, Range("B2:B10")) Is Nothing Then
If WorksheetFunction.CountIf(Worksheets("Sheet2").Ran ge("F2:F10"), _
Target.Value) 0 Then
MsgBox "Free time", vbExclamation, ""
Range("C" & Target.Row).Activate
End If
End If
End Sub

If this post helps click Yes
---------------
Jacob Skaria


"puiuluipui" wrote:

Hi Jacob, it's working, but if i have Jim in F2, then in sheet 1 the macro
display message only in B2. I need to have Jim in one cell in F column and if
in B2:B10 i have 10 entries with Jim, then the message to popup each time Jim
appear in this range.
In F column i will probably have 2 or 3 names, so i need to write this names
only one time and in B range the message to appear each time a name from F
range is written.

Thanks!

"Jacob Skaria" a scris:

Try the below. Right click Active sheet tabView Code and paste the below code

Private Sub Worksheet_Change(ByVal Target As Excel.Range)
If Not Application.Intersect(Target, Range("B2:B10")) Is Nothing Then
If Target.Value = Worksheets("Sheet2").Range("F" & Target.Row) Then
MsgBox "Free time", vbExclamation, ""
Range("C" & Target.Row).Activate
End If
End If
End Sub

If this post helps click Yes
---------------
Jacob Skaria


"puiuluipui" wrote:

Hi, can this be modified......

Private Sub Worksheet_Change(ByVal Target As Excel.Range)
If Target.Address = "$B$2" And UCase(Target.Value) = "Jim" Then
MsgBox "Free time", vbExclamation, ""
Range("C2").Activate
End If
End Sub

To something like this......?

Private Sub Worksheet_Change(ByVal Target As Excel.Range)
If Target.Address = "sheet1!B2:B10" And UCase(Target.Value) =
"sheet2!F2:F10" Then
MsgBox "Free time", vbExclamation, ""
Range("C2").Activate
End If
End Sub

Thanks!

  #8   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 8,520
Default Popup macro

Thanks for the feedback. While testing I found if you blank a cell blank it
returns an error. So you can replace with the below which will handle this..

Private Sub Worksheet_Change(ByVal Target As Excel.Range)
If Not Application.Intersect(Target, Range("B2:B10")) Is Nothing Then
If Trim(Target.Text) < "" Then
Application.EnableEvents = False
If WorksheetFunction.CountIf(Worksheets("Sheet2").Ran ge("F2:F10"), _
Split(Target.Value)(0)) 0 Then
MsgBox "Free time", vbExclamation, ""
Range("C" & Target.Row).Activate
End If
Application.EnableEvents = True
End If
End If

End Sub

If this post helps click Yes
---------------
Jacob Skaria


"puiuluipui" wrote:

You are the best!
Thanks allot!

"Jacob Skaria" a scris:

Modified to suit your requirement

Private Sub Worksheet_Change(ByVal Target As Excel.Range)
If Not Application.Intersect(Target, Range("B2:B10")) Is Nothing Then
If WorksheetFunction.CountIf(Worksheets("Sheet2").Ran ge("F2:F10"), _
Split(Target.Value)(0)) 0 Then
MsgBox "Free time", vbExclamation, ""
Range("C" & Target.Row).Activate
End If
End If
End Sub

If this post helps click Yes
---------------
Jacob Skaria


"puiuluipui" wrote:

Hi Jacob. It was my fault. i didn't explain better :). it's working now. I
need one more change if possible. I need the macro to work with cells that
begin with one word, but may have 2 or more. i need in F to write Jim, and in
B, the macro to popup even in cell is something like Jim Brown. If it begin
with Jim, then the macro to display message.
Can this be done?
Thanks!

"Jacob Skaria" a scris:

I would have probably misread your query. Try the below..

Private Sub Worksheet_Change(ByVal Target As Excel.Range)
If Not Application.Intersect(Target, Range("B2:B10")) Is Nothing Then
If WorksheetFunction.CountIf(Worksheets("Sheet2").Ran ge("F2:F10"), _
Target.Value) 0 Then
MsgBox "Free time", vbExclamation, ""
Range("C" & Target.Row).Activate
End If
End If
End Sub

If this post helps click Yes
---------------
Jacob Skaria


"puiuluipui" wrote:

Hi Jacob, it's working, but if i have Jim in F2, then in sheet 1 the macro
display message only in B2. I need to have Jim in one cell in F column and if
in B2:B10 i have 10 entries with Jim, then the message to popup each time Jim
appear in this range.
In F column i will probably have 2 or 3 names, so i need to write this names
only one time and in B range the message to appear each time a name from F
range is written.

Thanks!

"Jacob Skaria" a scris:

Try the below. Right click Active sheet tabView Code and paste the below code

Private Sub Worksheet_Change(ByVal Target As Excel.Range)
If Not Application.Intersect(Target, Range("B2:B10")) Is Nothing Then
If Target.Value = Worksheets("Sheet2").Range("F" & Target.Row) Then
MsgBox "Free time", vbExclamation, ""
Range("C" & Target.Row).Activate
End If
End If
End Sub

If this post helps click Yes
---------------
Jacob Skaria


"puiuluipui" wrote:

Hi, can this be modified......

Private Sub Worksheet_Change(ByVal Target As Excel.Range)
If Target.Address = "$B$2" And UCase(Target.Value) = "Jim" Then
MsgBox "Free time", vbExclamation, ""
Range("C2").Activate
End If
End Sub

To something like this......?

Private Sub Worksheet_Change(ByVal Target As Excel.Range)
If Target.Address = "sheet1!B2:B10" And UCase(Target.Value) =
"sheet2!F2:F10" Then
MsgBox "Free time", vbExclamation, ""
Range("C2").Activate
End If
End Sub

Thanks!

  #9   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 468
Default Popup macro

You are really professional. Thanks allot! You were right again.:)
Thanks!

"Jacob Skaria" a scris:

Thanks for the feedback. While testing I found if you blank a cell blank it
returns an error. So you can replace with the below which will handle this..

Private Sub Worksheet_Change(ByVal Target As Excel.Range)
If Not Application.Intersect(Target, Range("B2:B10")) Is Nothing Then
If Trim(Target.Text) < "" Then
Application.EnableEvents = False
If WorksheetFunction.CountIf(Worksheets("Sheet2").Ran ge("F2:F10"), _
Split(Target.Value)(0)) 0 Then
MsgBox "Free time", vbExclamation, ""
Range("C" & Target.Row).Activate
End If
Application.EnableEvents = True
End If
End If

End Sub

If this post helps click Yes
---------------
Jacob Skaria


"puiuluipui" wrote:

You are the best!
Thanks allot!

"Jacob Skaria" a scris:

Modified to suit your requirement

Private Sub Worksheet_Change(ByVal Target As Excel.Range)
If Not Application.Intersect(Target, Range("B2:B10")) Is Nothing Then
If WorksheetFunction.CountIf(Worksheets("Sheet2").Ran ge("F2:F10"), _
Split(Target.Value)(0)) 0 Then
MsgBox "Free time", vbExclamation, ""
Range("C" & Target.Row).Activate
End If
End If
End Sub

If this post helps click Yes
---------------
Jacob Skaria


"puiuluipui" wrote:

Hi Jacob. It was my fault. i didn't explain better :). it's working now. I
need one more change if possible. I need the macro to work with cells that
begin with one word, but may have 2 or more. i need in F to write Jim, and in
B, the macro to popup even in cell is something like Jim Brown. If it begin
with Jim, then the macro to display message.
Can this be done?
Thanks!

"Jacob Skaria" a scris:

I would have probably misread your query. Try the below..

Private Sub Worksheet_Change(ByVal Target As Excel.Range)
If Not Application.Intersect(Target, Range("B2:B10")) Is Nothing Then
If WorksheetFunction.CountIf(Worksheets("Sheet2").Ran ge("F2:F10"), _
Target.Value) 0 Then
MsgBox "Free time", vbExclamation, ""
Range("C" & Target.Row).Activate
End If
End If
End Sub

If this post helps click Yes
---------------
Jacob Skaria


"puiuluipui" wrote:

Hi Jacob, it's working, but if i have Jim in F2, then in sheet 1 the macro
display message only in B2. I need to have Jim in one cell in F column and if
in B2:B10 i have 10 entries with Jim, then the message to popup each time Jim
appear in this range.
In F column i will probably have 2 or 3 names, so i need to write this names
only one time and in B range the message to appear each time a name from F
range is written.

Thanks!

"Jacob Skaria" a scris:

Try the below. Right click Active sheet tabView Code and paste the below code

Private Sub Worksheet_Change(ByVal Target As Excel.Range)
If Not Application.Intersect(Target, Range("B2:B10")) Is Nothing Then
If Target.Value = Worksheets("Sheet2").Range("F" & Target.Row) Then
MsgBox "Free time", vbExclamation, ""
Range("C" & Target.Row).Activate
End If
End If
End Sub

If this post helps click Yes
---------------
Jacob Skaria


"puiuluipui" wrote:

Hi, can this be modified......

Private Sub Worksheet_Change(ByVal Target As Excel.Range)
If Target.Address = "$B$2" And UCase(Target.Value) = "Jim" Then
MsgBox "Free time", vbExclamation, ""
Range("C2").Activate
End If
End Sub

To something like this......?

Private Sub Worksheet_Change(ByVal Target As Excel.Range)
If Target.Address = "sheet1!B2:B10" And UCase(Target.Value) =
"sheet2!F2:F10" Then
MsgBox "Free time", vbExclamation, ""
Range("C2").Activate
End If
End Sub

Thanks!

  #10   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 468
Default Popup macro

Hi, Jacob, can this code be made to work from a module and to work with only
5 sheets from 7? I have another macro in these sheets and it's an conflict
between old macro and your macro.
Thanks!

"Jacob Skaria" a scris:

Thanks for the feedback. While testing I found if you blank a cell blank it
returns an error. So you can replace with the below which will handle this..

Private Sub Worksheet_Change(ByVal Target As Excel.Range)
If Not Application.Intersect(Target, Range("B2:B10")) Is Nothing Then
If Trim(Target.Text) < "" Then
Application.EnableEvents = False
If WorksheetFunction.CountIf(Worksheets("Sheet2").Ran ge("F2:F10"), _
Split(Target.Value)(0)) 0 Then
MsgBox "Free time", vbExclamation, ""
Range("C" & Target.Row).Activate
End If
Application.EnableEvents = True
End If
End If

End Sub

If this post helps click Yes
---------------
Jacob Skaria


"puiuluipui" wrote:

You are the best!
Thanks allot!

"Jacob Skaria" a scris:

Modified to suit your requirement

Private Sub Worksheet_Change(ByVal Target As Excel.Range)
If Not Application.Intersect(Target, Range("B2:B10")) Is Nothing Then
If WorksheetFunction.CountIf(Worksheets("Sheet2").Ran ge("F2:F10"), _
Split(Target.Value)(0)) 0 Then
MsgBox "Free time", vbExclamation, ""
Range("C" & Target.Row).Activate
End If
End If
End Sub

If this post helps click Yes
---------------
Jacob Skaria


"puiuluipui" wrote:

Hi Jacob. It was my fault. i didn't explain better :). it's working now. I
need one more change if possible. I need the macro to work with cells that
begin with one word, but may have 2 or more. i need in F to write Jim, and in
B, the macro to popup even in cell is something like Jim Brown. If it begin
with Jim, then the macro to display message.
Can this be done?
Thanks!

"Jacob Skaria" a scris:

I would have probably misread your query. Try the below..

Private Sub Worksheet_Change(ByVal Target As Excel.Range)
If Not Application.Intersect(Target, Range("B2:B10")) Is Nothing Then
If WorksheetFunction.CountIf(Worksheets("Sheet2").Ran ge("F2:F10"), _
Target.Value) 0 Then
MsgBox "Free time", vbExclamation, ""
Range("C" & Target.Row).Activate
End If
End If
End Sub

If this post helps click Yes
---------------
Jacob Skaria


"puiuluipui" wrote:

Hi Jacob, it's working, but if i have Jim in F2, then in sheet 1 the macro
display message only in B2. I need to have Jim in one cell in F column and if
in B2:B10 i have 10 entries with Jim, then the message to popup each time Jim
appear in this range.
In F column i will probably have 2 or 3 names, so i need to write this names
only one time and in B range the message to appear each time a name from F
range is written.

Thanks!

"Jacob Skaria" a scris:

Try the below. Right click Active sheet tabView Code and paste the below code

Private Sub Worksheet_Change(ByVal Target As Excel.Range)
If Not Application.Intersect(Target, Range("B2:B10")) Is Nothing Then
If Target.Value = Worksheets("Sheet2").Range("F" & Target.Row) Then
MsgBox "Free time", vbExclamation, ""
Range("C" & Target.Row).Activate
End If
End If
End Sub

If this post helps click Yes
---------------
Jacob Skaria


"puiuluipui" wrote:

Hi, can this be modified......

Private Sub Worksheet_Change(ByVal Target As Excel.Range)
If Target.Address = "$B$2" And UCase(Target.Value) = "Jim" Then
MsgBox "Free time", vbExclamation, ""
Range("C2").Activate
End If
End Sub

To something like this......?

Private Sub Worksheet_Change(ByVal Target As Excel.Range)
If Target.Address = "sheet1!B2:B10" And UCase(Target.Value) =
"sheet2!F2:F10" Then
MsgBox "Free time", vbExclamation, ""
Range("C2").Activate
End If
End Sub

Thanks!



  #11   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 8,520
Default Popup macro

Hi "puiuluipui"

You dont need to move that to a module. From workbook press Alt+F11 to
launch VBE (Visual Basic Editor). From the left treeview search for the
workbook name and click on + to expand it. Within that you should see the
following

VBAProject(Your_Filename)
Microsoft Excel Objects
Sheet1(Sheet1)
Sheet2(Sheet2)
Sheet3(Sheet3)
This Workbook

Double click 'This WorkBook' and paste the below code to the right code
pane. Similar to sheet change events we have Workbook change events here. The
code runs for all sheets except Sheet1 and Sheet2. Adjust to suit

Private Sub Workbook_SheetChange(ByVal Sh As Object, ByVal Target As Range)
If Sh.Name < "Sheet1" And Sh.Name < "Sheet2" Then
If Not Application.Intersect(Target, Range("B2:B10")) Is Nothing Then
If Trim(Target.Text) < "" Then
Application.EnableEvents = False
If WorksheetFunction.CountIf(Worksheets("Sheet2").Ran ge("F2:F10"), _
Split(Target.Value)(0)) 0 Then
MsgBox "Free time", vbExclamation, ""
Range("C" & Target.Row).Activate
End If
Application.EnableEvents = True
End If
End If
End If
End Sub

If this post helps click Yes
---------------
Jacob Skaria


"puiuluipui" wrote:

Hi, Jacob, can this code be made to work from a module and to work with only
5 sheets from 7? I have another macro in these sheets and it's an conflict
between old macro and your macro.
Thanks!

"Jacob Skaria" a scris:

Thanks for the feedback. While testing I found if you blank a cell blank it
returns an error. So you can replace with the below which will handle this..

Private Sub Worksheet_Change(ByVal Target As Excel.Range)
If Not Application.Intersect(Target, Range("B2:B10")) Is Nothing Then
If Trim(Target.Text) < "" Then
Application.EnableEvents = False
If WorksheetFunction.CountIf(Worksheets("Sheet2").Ran ge("F2:F10"), _
Split(Target.Value)(0)) 0 Then
MsgBox "Free time", vbExclamation, ""
Range("C" & Target.Row).Activate
End If
Application.EnableEvents = True
End If
End If

End Sub

If this post helps click Yes
---------------
Jacob Skaria


"puiuluipui" wrote:

You are the best!
Thanks allot!

"Jacob Skaria" a scris:

Modified to suit your requirement

Private Sub Worksheet_Change(ByVal Target As Excel.Range)
If Not Application.Intersect(Target, Range("B2:B10")) Is Nothing Then
If WorksheetFunction.CountIf(Worksheets("Sheet2").Ran ge("F2:F10"), _
Split(Target.Value)(0)) 0 Then
MsgBox "Free time", vbExclamation, ""
Range("C" & Target.Row).Activate
End If
End If
End Sub

If this post helps click Yes
---------------
Jacob Skaria


"puiuluipui" wrote:

Hi Jacob. It was my fault. i didn't explain better :). it's working now. I
need one more change if possible. I need the macro to work with cells that
begin with one word, but may have 2 or more. i need in F to write Jim, and in
B, the macro to popup even in cell is something like Jim Brown. If it begin
with Jim, then the macro to display message.
Can this be done?
Thanks!

"Jacob Skaria" a scris:

I would have probably misread your query. Try the below..

Private Sub Worksheet_Change(ByVal Target As Excel.Range)
If Not Application.Intersect(Target, Range("B2:B10")) Is Nothing Then
If WorksheetFunction.CountIf(Worksheets("Sheet2").Ran ge("F2:F10"), _
Target.Value) 0 Then
MsgBox "Free time", vbExclamation, ""
Range("C" & Target.Row).Activate
End If
End If
End Sub

If this post helps click Yes
---------------
Jacob Skaria


"puiuluipui" wrote:

Hi Jacob, it's working, but if i have Jim in F2, then in sheet 1 the macro
display message only in B2. I need to have Jim in one cell in F column and if
in B2:B10 i have 10 entries with Jim, then the message to popup each time Jim
appear in this range.
In F column i will probably have 2 or 3 names, so i need to write this names
only one time and in B range the message to appear each time a name from F
range is written.

Thanks!

"Jacob Skaria" a scris:

Try the below. Right click Active sheet tabView Code and paste the below code

Private Sub Worksheet_Change(ByVal Target As Excel.Range)
If Not Application.Intersect(Target, Range("B2:B10")) Is Nothing Then
If Target.Value = Worksheets("Sheet2").Range("F" & Target.Row) Then
MsgBox "Free time", vbExclamation, ""
Range("C" & Target.Row).Activate
End If
End If
End Sub

If this post helps click Yes
---------------
Jacob Skaria


"puiuluipui" wrote:

Hi, can this be modified......

Private Sub Worksheet_Change(ByVal Target As Excel.Range)
If Target.Address = "$B$2" And UCase(Target.Value) = "Jim" Then
MsgBox "Free time", vbExclamation, ""
Range("C2").Activate
End If
End Sub

To something like this......?

Private Sub Worksheet_Change(ByVal Target As Excel.Range)
If Target.Address = "sheet1!B2:B10" And UCase(Target.Value) =
"sheet2!F2:F10" Then
MsgBox "Free time", vbExclamation, ""
Range("C2").Activate
End If
End Sub

Thanks!

  #12   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 468
Default Popup macro

It's perfect.
Thanks allot!

"Jacob Skaria" a scris:

Hi "puiuluipui"

You dont need to move that to a module. From workbook press Alt+F11 to
launch VBE (Visual Basic Editor). From the left treeview search for the
workbook name and click on + to expand it. Within that you should see the
following

VBAProject(Your_Filename)
Microsoft Excel Objects
Sheet1(Sheet1)
Sheet2(Sheet2)
Sheet3(Sheet3)
This Workbook

Double click 'This WorkBook' and paste the below code to the right code
pane. Similar to sheet change events we have Workbook change events here. The
code runs for all sheets except Sheet1 and Sheet2. Adjust to suit

Private Sub Workbook_SheetChange(ByVal Sh As Object, ByVal Target As Range)
If Sh.Name < "Sheet1" And Sh.Name < "Sheet2" Then
If Not Application.Intersect(Target, Range("B2:B10")) Is Nothing Then
If Trim(Target.Text) < "" Then
Application.EnableEvents = False
If WorksheetFunction.CountIf(Worksheets("Sheet2").Ran ge("F2:F10"), _
Split(Target.Value)(0)) 0 Then
MsgBox "Free time", vbExclamation, ""
Range("C" & Target.Row).Activate
End If
Application.EnableEvents = True
End If
End If
End If
End Sub

If this post helps click Yes
---------------
Jacob Skaria


"puiuluipui" wrote:

Hi, Jacob, can this code be made to work from a module and to work with only
5 sheets from 7? I have another macro in these sheets and it's an conflict
between old macro and your macro.
Thanks!

"Jacob Skaria" a scris:

Thanks for the feedback. While testing I found if you blank a cell blank it
returns an error. So you can replace with the below which will handle this..

Private Sub Worksheet_Change(ByVal Target As Excel.Range)
If Not Application.Intersect(Target, Range("B2:B10")) Is Nothing Then
If Trim(Target.Text) < "" Then
Application.EnableEvents = False
If WorksheetFunction.CountIf(Worksheets("Sheet2").Ran ge("F2:F10"), _
Split(Target.Value)(0)) 0 Then
MsgBox "Free time", vbExclamation, ""
Range("C" & Target.Row).Activate
End If
Application.EnableEvents = True
End If
End If

End Sub

If this post helps click Yes
---------------
Jacob Skaria


"puiuluipui" wrote:

You are the best!
Thanks allot!

"Jacob Skaria" a scris:

Modified to suit your requirement

Private Sub Worksheet_Change(ByVal Target As Excel.Range)
If Not Application.Intersect(Target, Range("B2:B10")) Is Nothing Then
If WorksheetFunction.CountIf(Worksheets("Sheet2").Ran ge("F2:F10"), _
Split(Target.Value)(0)) 0 Then
MsgBox "Free time", vbExclamation, ""
Range("C" & Target.Row).Activate
End If
End If
End Sub

If this post helps click Yes
---------------
Jacob Skaria


"puiuluipui" wrote:

Hi Jacob. It was my fault. i didn't explain better :). it's working now. I
need one more change if possible. I need the macro to work with cells that
begin with one word, but may have 2 or more. i need in F to write Jim, and in
B, the macro to popup even in cell is something like Jim Brown. If it begin
with Jim, then the macro to display message.
Can this be done?
Thanks!

"Jacob Skaria" a scris:

I would have probably misread your query. Try the below..

Private Sub Worksheet_Change(ByVal Target As Excel.Range)
If Not Application.Intersect(Target, Range("B2:B10")) Is Nothing Then
If WorksheetFunction.CountIf(Worksheets("Sheet2").Ran ge("F2:F10"), _
Target.Value) 0 Then
MsgBox "Free time", vbExclamation, ""
Range("C" & Target.Row).Activate
End If
End If
End Sub

If this post helps click Yes
---------------
Jacob Skaria


"puiuluipui" wrote:

Hi Jacob, it's working, but if i have Jim in F2, then in sheet 1 the macro
display message only in B2. I need to have Jim in one cell in F column and if
in B2:B10 i have 10 entries with Jim, then the message to popup each time Jim
appear in this range.
In F column i will probably have 2 or 3 names, so i need to write this names
only one time and in B range the message to appear each time a name from F
range is written.

Thanks!

"Jacob Skaria" a scris:

Try the below. Right click Active sheet tabView Code and paste the below code

Private Sub Worksheet_Change(ByVal Target As Excel.Range)
If Not Application.Intersect(Target, Range("B2:B10")) Is Nothing Then
If Target.Value = Worksheets("Sheet2").Range("F" & Target.Row) Then
MsgBox "Free time", vbExclamation, ""
Range("C" & Target.Row).Activate
End If
End If
End Sub

If this post helps click Yes
---------------
Jacob Skaria


"puiuluipui" wrote:

Hi, can this be modified......

Private Sub Worksheet_Change(ByVal Target As Excel.Range)
If Target.Address = "$B$2" And UCase(Target.Value) = "Jim" Then
MsgBox "Free time", vbExclamation, ""
Range("C2").Activate
End If
End Sub

To something like this......?

Private Sub Worksheet_Change(ByVal Target As Excel.Range)
If Target.Address = "sheet1!B2:B10" And UCase(Target.Value) =
"sheet2!F2:F10" Then
MsgBox "Free time", vbExclamation, ""
Range("C2").Activate
End If
End Sub

Thanks!

  #13   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 468
Default Popup macro

Hi Jacob, i have a small problem with your code. I need messages to be
extracted from a list(range, G2:G10).

I need to change this line:
MsgBox "Free time", vbExclamation, ""
with something like this:
If WorksheetFunction.CountIf(Worksheets("Sheet2").Ran ge("F2:F10"), _

This how i see it. Maybe it's more than change this line, but i tried to
show you what i need.
If in sheet3 in range B2:B10 i write Jim, then the code to search in sheet 2
range F2:F10, and when the code find Jim in a cell, then to display a message
found in next cell to john.
I just need the code to be just like this one, but the message to be the one
next to the name i am searching for, so every name to have his own message.
Can this be done?
Thanks!

"Jacob Skaria" wrote:

Hi "puiuluipui"

You dont need to move that to a module. From workbook press Alt+F11 to
launch VBE (Visual Basic Editor). From the left treeview search for the
workbook name and click on + to expand it. Within that you should see the
following

VBAProject(Your_Filename)
Microsoft Excel Objects
Sheet1(Sheet1)
Sheet2(Sheet2)
Sheet3(Sheet3)
This Workbook

Double click 'This WorkBook' and paste the below code to the right code
pane. Similar to sheet change events we have Workbook change events here. The
code runs for all sheets except Sheet1 and Sheet2. Adjust to suit

Private Sub Workbook_SheetChange(ByVal Sh As Object, ByVal Target As Range)
If Sh.Name < "Sheet1" And Sh.Name < "Sheet2" Then
If Not Application.Intersect(Target, Range("B2:B10")) Is Nothing Then
If Trim(Target.Text) < "" Then
Application.EnableEvents = False
If WorksheetFunction.CountIf(Worksheets("Sheet2").Ran ge("F2:F10"), _
Split(Target.Value)(0)) 0 Then
MsgBox "Free time", vbExclamation, ""
Range("C" & Target.Row).Activate
End If
Application.EnableEvents = True
End If
End If
End If
End Sub

If this post helps click Yes
---------------
Jacob Skaria


"puiuluipui" wrote:

Hi, Jacob, can this code be made to work from a module and to work with only
5 sheets from 7? I have another macro in these sheets and it's an conflict
between old macro and your macro.
Thanks!

"Jacob Skaria" a scris:

Thanks for the feedback. While testing I found if you blank a cell blank it
returns an error. So you can replace with the below which will handle this..

Private Sub Worksheet_Change(ByVal Target As Excel.Range)
If Not Application.Intersect(Target, Range("B2:B10")) Is Nothing Then
If Trim(Target.Text) < "" Then
Application.EnableEvents = False
If WorksheetFunction.CountIf(Worksheets("Sheet2").Ran ge("F2:F10"), _
Split(Target.Value)(0)) 0 Then
MsgBox "Free time", vbExclamation, ""
Range("C" & Target.Row).Activate
End If
Application.EnableEvents = True
End If
End If

End Sub

If this post helps click Yes
---------------
Jacob Skaria


"puiuluipui" wrote:

You are the best!
Thanks allot!

"Jacob Skaria" a scris:

Modified to suit your requirement

Private Sub Worksheet_Change(ByVal Target As Excel.Range)
If Not Application.Intersect(Target, Range("B2:B10")) Is Nothing Then
If WorksheetFunction.CountIf(Worksheets("Sheet2").Ran ge("F2:F10"), _
Split(Target.Value)(0)) 0 Then
MsgBox "Free time", vbExclamation, ""
Range("C" & Target.Row).Activate
End If
End If
End Sub

If this post helps click Yes
---------------
Jacob Skaria


"puiuluipui" wrote:

Hi Jacob. It was my fault. i didn't explain better :). it's working now. I
need one more change if possible. I need the macro to work with cells that
begin with one word, but may have 2 or more. i need in F to write Jim, and in
B, the macro to popup even in cell is something like Jim Brown. If it begin
with Jim, then the macro to display message.
Can this be done?
Thanks!

"Jacob Skaria" a scris:

I would have probably misread your query. Try the below..

Private Sub Worksheet_Change(ByVal Target As Excel.Range)
If Not Application.Intersect(Target, Range("B2:B10")) Is Nothing Then
If WorksheetFunction.CountIf(Worksheets("Sheet2").Ran ge("F2:F10"), _
Target.Value) 0 Then
MsgBox "Free time", vbExclamation, ""
Range("C" & Target.Row).Activate
End If
End If
End Sub

If this post helps click Yes
---------------
Jacob Skaria


"puiuluipui" wrote:

Hi Jacob, it's working, but if i have Jim in F2, then in sheet 1 the macro
display message only in B2. I need to have Jim in one cell in F column and if
in B2:B10 i have 10 entries with Jim, then the message to popup each time Jim
appear in this range.
In F column i will probably have 2 or 3 names, so i need to write this names
only one time and in B range the message to appear each time a name from F
range is written.

Thanks!

"Jacob Skaria" a scris:

Try the below. Right click Active sheet tabView Code and paste the below code

Private Sub Worksheet_Change(ByVal Target As Excel.Range)
If Not Application.Intersect(Target, Range("B2:B10")) Is Nothing Then
If Target.Value = Worksheets("Sheet2").Range("F" & Target.Row) Then
MsgBox "Free time", vbExclamation, ""
Range("C" & Target.Row).Activate
End If
End If
End Sub

If this post helps click Yes
---------------
Jacob Skaria


"puiuluipui" wrote:

Hi, can this be modified......

Private Sub Worksheet_Change(ByVal Target As Excel.Range)
If Target.Address = "$B$2" And UCase(Target.Value) = "Jim" Then
MsgBox "Free time", vbExclamation, ""
Range("C2").Activate
End If
End Sub

To something like this......?

Private Sub Worksheet_Change(ByVal Target As Excel.Range)
If Target.Address = "sheet1!B2:B10" And UCase(Target.Value) =
"sheet2!F2:F10" Then
MsgBox "Free time", vbExclamation, ""
Range("C2").Activate
End If
End Sub

Thanks!

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
Popup box moving to new tab Michele New Users to Excel 5 June 20th 09 07:25 PM
Excel POPUP [email protected] Excel Worksheet Functions 0 March 26th 08 12:02 PM
Popup MsgBox jackle Excel Discussion (Misc queries) 1 February 13th 06 03:44 AM
Add a warning popup to a Macro Button Teresa Excel Worksheet Functions 4 January 16th 06 09:27 PM
"Why did we get here????" popup jtwspoon Excel Discussion (Misc queries) 3 February 4th 05 04:57 AM


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

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

About Us

"It's about Microsoft Excel"