Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 123
Default Certain string in cell A1 causes a change in Cell B1

Dear Experts:

I would like to run a macro with the following requirements.

As soon as the cell value in A1 changes and the string "Mont" is part
of the cell value in A1, the Contents of B1 is to change to "This is
the responsibility of...). If this not the case nothing is to be
displayed in Cell B1

Help is much appreciated. Thank you very much in advance.

Regards, Andreas

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 694
Default Certain string in cell A1 causes a change in Cell B1

Hi
Would a formula do ?, if yes try this..
=IF(ISERROR(SEARCH("Mont",A1,1)),"","This is
the responsibility of..")
HTH
John
"andreashermle" wrote in message
...
Dear Experts:

I would like to run a macro with the following requirements.

As soon as the cell value in A1 changes and the string "Mont" is part
of the cell value in A1, the Contents of B1 is to change to "This is
the responsibility of...). If this not the case nothing is to be
displayed in Cell B1

Help is much appreciated. Thank you very much in advance.

Regards, Andreas


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 123
Default Certain string in cell A1 causes a change in Cell B1

On 25 Feb., 15:53, "John" wrote:
Hi
Would a formula do ?, if yes try this..
=IF(ISERROR(SEARCH("Mont",A1,1)),"","This is
the responsibility of..")
HTH
John"andreashermle" wrote in message

...



Dear Experts:


I would like to run a macro with the following requirements.


As soon as the cell value in A1 changes and the string "Mont" is part
of the cell value in A1, the Contents of B1 is to change to "This is
the responsibility of...). If this not the case nothing is to be
displayed in Cell B1


Help is much appreciated. Thank you very much in advance.


Regards, Andreas- Zitierten Text ausblenden -


- Zitierten Text anzeigen -


Hi John,

great. It is working as desired. Thank you very much for your terrific
help.
Regards, Andreas
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 694
Default Certain string in cell A1 causes a change in Cell B1

Hi Andreashermle
You're welcome, anytime..
Regards
John
"andreashermle" wrote in message
...
On 25 Feb., 15:53, "John" wrote:
Hi
Would a formula do ?, if yes try this..
=IF(ISERROR(SEARCH("Mont",A1,1)),"","This is
the responsibility of..")
HTH
John"andreashermle" wrote in message

...



Dear Experts:


I would like to run a macro with the following requirements.


As soon as the cell value in A1 changes and the string "Mont" is part
of the cell value in A1, the Contents of B1 is to change to "This is
the responsibility of...). If this not the case nothing is to be
displayed in Cell B1


Help is much appreciated. Thank you very much in advance.


Regards, Andreas- Zitierten Text ausblenden -


- Zitierten Text anzeigen -


Hi John,

great. It is working as desired. Thank you very much for your terrific
help.
Regards, Andreas


  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,565
Default Certain string in cell A1 causes a change in Cell B1

This code is to be pasted into the sheet code module for the sheet with the
applicable cells a1 and b1. Right click the sheet name tab and select View
Code from the pop up menu. The appropriate code window should open.

Private Sub Worksheet_Change(ByVal Target As Range)
If Target = Range("A1") Then
If InStr(1, LCase(Target.Value), "mont") 0 Then
Range("B1") = "This is the responsibility of..."
Else
Range("B1") = ""
End If
End If
End Sub



"andreashermle" wrote in message
...
Dear Experts:

I would like to run a macro with the following requirements.

As soon as the cell value in A1 changes and the string "Mont" is part
of the cell value in A1, the Contents of B1 is to change to "This is
the responsibility of...). If this not the case nothing is to be
displayed in Cell B1

Help is much appreciated. Thank you very much in advance.

Regards, Andreas





  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 123
Default Certain string in cell A1 causes a change in Cell B1

On 25 Feb., 16:03, "JLGWhiz" wrote:
This code is to be pasted into the sheet code module for the sheet with the
applicable cells a1 and b1. *Right click the sheet name tab and select View
Code from the pop up menu. *The appropriate code window should open.

Private Sub Worksheet_Change(ByVal Target As Range)
* If Target = Range("A1") Then
* * If InStr(1, LCase(Target.Value), "mont") 0 Then
* * * *Range("B1") = "This is the responsibility of..."
* * Else
* * * *Range("B1") = ""
* * End If
* End If
End Sub

"andreashermle" wrote in message

...



Dear Experts:


I would like to run a macro with the following requirements.


As soon as the cell value in A1 changes and the string "Mont" is part
of the cell value in A1, the Contents of B1 is to change to "This is
the responsibility of...). If this not the case nothing is to be
displayed in Cell B1


Help is much appreciated. Thank you very much in advance.


Regards, Andreas- Zitierten Text ausblenden -


- Zitierten Text anzeigen -


Hi JLG,

great / terrfic help. It works just fine. Regards, Andreas
  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,501
Default Certain string in cell A1 causes a change in Cell B1

Hi,

may be this

Private Sub Worksheet_Change(ByVal Target As Range)
If InStr(1, Range("A1"), "Mont", vbTextCompare) 0 Then
Application.EnableEvents = False
Range("B1").Value = "This is the responsibility of...)"
Else
Range("B1").ClearContents
End If
Application.EnableEvents = True
End Sub
--
Mike

When competing hypotheses are otherwise equal, adopt the hypothesis that
introduces the fewest assumptions while still sufficiently answering the
question.


"andreashermle" wrote:

Dear Experts:

I would like to run a macro with the following requirements.

As soon as the cell value in A1 changes and the string "Mont" is part
of the cell value in A1, the Contents of B1 is to change to "This is
the responsibility of...). If this not the case nothing is to be
displayed in Cell B1

Help is much appreciated. Thank you very much in advance.

Regards, Andreas

.

  #8   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 123
Default Certain string in cell A1 causes a change in Cell B1

On 25 Feb., 16:28, Mike H wrote:
Hi,

may be this

Private Sub Worksheet_Change(ByVal Target As Range)
If InStr(1, Range("A1"), "Mont", vbTextCompare) 0 Then
Application.EnableEvents = False
* * Range("B1").Value = "This is the responsibility of...)"
Else
* * Range("B1").ClearContents
End If
Application.EnableEvents = True
End Sub
--
Mike

When competing hypotheses are otherwise equal, adopt the hypothesis that
introduces the fewest assumptions while still sufficiently answering the
question.



"andreashermle" wrote:
Dear Experts:


I would like to run a macro with the following requirements.


As soon as the cell value in A1 changes and the string "Mont" is part
of the cell value in A1, the Contents of B1 is to change to "This is
the responsibility of...). If this not the case nothing is to be
displayed in Cell B1


Help is much appreciated. Thank you very much in advance.


Regards, Andreas


.- Zitierten Text ausblenden -


- Zitierten Text anzeigen -


Hi Mike.

Great support. Thank you very much. It works as desired. Regards,
Andreas
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
Change Number to Text , Case error when cell is String and format isGeneral moonhk[_2_] Excel Programming 2 February 19th 10 06:01 AM
word match in string text in cell, color format cell jpmahony Excel Discussion (Misc queries) 1 October 31st 07 03:56 PM
FIND / SEARCH text compare cell to string in 3rd cell nastech Excel Discussion (Misc queries) 0 October 29th 07 02:51 AM
I need to change cell string lenths prior to upload into sql table kevt Excel Worksheet Functions 1 September 6th 06 06:44 PM
A Macro to replace a string in a cell with a string from another cell??? Plica05 Excel Programming 2 August 16th 05 09:23 AM


All times are GMT +1. The time now is 03:07 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"