Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default Alter one cell value, in case another cell's value changed

Hello everybody

I am new in Excel macro programming

Is there any ways to fill some words "remarks" into Cell B2 in Eecel worksheet, in case Cell A1 value has been modified. I don't know how to inplement the actual Excel macro code but using pseudocode to represent my meaning, say

in Cell B, fill formula:

= If cells('A1').value != originalValue The
cells('B1').value = "Cell A1 has been modified on " & Date(
End I

Kindly tell how to convert the above meaning into extual Excel macro code

Thanks & regards

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default Alter one cell value, in case another cell's value changed

Here is some code

Private Sub Worksheet_Change(ByVal Target As Range)

On Error GoTo ws_exit:
Application.EnableEvents = False
If Not Intersect(Target, Me.Range("A1")) Is Nothing Then
With Target
.Offset(0, 1).Value = "Cell " & Target.Address(False,False) & _
" has been modified on " & _
Format(Date, "dd mmm yyyy")
End With
End If

ws_exit:
Application.EnableEvents = True
End Sub

'This is worksheet event code, which means that it needs to be
'placed in the appropriate worksheet code module, not a standard
'code module. To do this, right-click on the sheet tab, select
'the View Code option from the menu, and paste the code in.



--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"myBasic" wrote in message
...
Hello everybody,

I am new in Excel macro programming.

Is there any ways to fill some words "remarks" into Cell B2 in Eecel

worksheet, in case Cell A1 value has been modified. I don't know how to
inplement the actual Excel macro code but using pseudocode to represent my
meaning, say:

in Cell B, fill formula:

= If cells('A1').value != originalValue Then
cells('B1').value = "Cell A1 has been modified on " & Date()
End If

Kindly tell how to convert the above meaning into extual Excel macro code.

Thanks & regards.



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default Alter one cell value, in case another cell's value changed

Hi Bob

Your code works fine, thanks.

But how to apply the code to following rows, ie, let's illustrate with the code

If Not Intersect(Target, Me.Range("A1")) Then change Cell A2 value.
If Not Intersect(Target, Me.Range("B1")) Then change Cell B2 value.
If Not Intersect(Target, Me.Range("C1")) Then change Cell C2 value.
If Not Intersect(Target, Me.Range("D1")) Then change Cell D2 value..
..

thanks




----- Bob Phillips wrote: ----

Here is some cod

Private Sub Worksheet_Change(ByVal Target As Range

On Error GoTo ws_exit
Application.EnableEvents = Fals
If Not Intersect(Target, Me.Range("A1")) Is Nothing The
With Targe
.Offset(0, 1).Value = "Cell " & Target.Address(False,False) &
" has been modified on " &
Format(Date, "dd mmm yyyy"
End Wit
End I

ws_exit
Application.EnableEvents = Tru
End Su

'This is worksheet event code, which means that it needs to b
'placed in the appropriate worksheet code module, not a standar
'code module. To do this, right-click on the sheet tab, selec
'the View Code option from the menu, and paste the code in



--

HT

Bob Phillip
... looking out across Poole Harbour to the Purbeck
(remove nothere from the email address if mailing direct

"myBasic" wrote in messag
..
Hello everybody
I am new in Excel macro programming
Is there any ways to fill some words "remarks" into Cell B2 in Eece

worksheet, in case Cell A1 value has been modified. I don't know how t
inplement the actual Excel macro code but using pseudocode to represent m
meaning, say
in Cell B, fill formula
= If cells('A1').value != originalValue The

cells('B1').value = "Cell A1 has been modified on " & Date(
End I
Kindly tell how to convert the above meaning into extual Excel macro code
Thanks & regards


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default Alter one cell value, in case another cell's value changed

Private Sub Worksheet_Change(ByVal Target As Range)

On Error GoTo ws_exit:
Application.EnableEvents = False
If Not Intersect(Target, Me.Range("A1,B1,C1,D1")) Is Nothing Then
With Target
.Offset(1, 0).Value = "Cell " & Target.Address(False, False) & _
" has been modified on " & _
Format(Date, "dd mmm yyyy")
End With
End If

ws_exit:
Application.EnableEvents = True
End Sub


--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"myBasic" wrote in message
...
Hi Bob,

Your code works fine, thanks.

But how to apply the code to following rows, ie, let's illustrate with the

code.

If Not Intersect(Target, Me.Range("A1")) Then change Cell A2 value..
If Not Intersect(Target, Me.Range("B1")) Then change Cell B2 value..
If Not Intersect(Target, Me.Range("C1")) Then change Cell C2 value..
If Not Intersect(Target, Me.Range("D1")) Then change Cell D2 value..
...

thanks.







----- Bob Phillips wrote: -----

Here is some code

Private Sub Worksheet_Change(ByVal Target As Range)

On Error GoTo ws_exit:
Application.EnableEvents = False
If Not Intersect(Target, Me.Range("A1")) Is Nothing Then
With Target
.Offset(0, 1).Value = "Cell " &

Target.Address(False,False) & _
" has been modified on " & _
Format(Date, "dd mmm yyyy")
End With
End If

ws_exit:
Application.EnableEvents = True
End Sub

'This is worksheet event code, which means that it needs to be
'placed in the appropriate worksheet code module, not a standard
'code module. To do this, right-click on the sheet tab, select
'the View Code option from the menu, and paste the code in.



--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"myBasic" wrote in message
...
Hello everybody,
I am new in Excel macro programming.
Is there any ways to fill some words "remarks" into Cell B2 in

Eecel
worksheet, in case Cell A1 value has been modified. I don't know how

to
inplement the actual Excel macro code but using pseudocode to

represent my
meaning, say:
in Cell B, fill formula:
= If cells('A1').value != originalValue Then

cells('B1').value = "Cell A1 has been modified on " & Date()
End If
Kindly tell how to convert the above meaning into extual Excel

macro code.
Thanks & regards.




  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default Alter one cell value, in case another cell's value changed

It works fine, thank you, Bob


----- Bob Phillips wrote: ----

Private Sub Worksheet_Change(ByVal Target As Range

On Error GoTo ws_exit
Application.EnableEvents = Fals
If Not Intersect(Target, Me.Range("A1,B1,C1,D1")) Is Nothing The
With Targe
.Offset(1, 0).Value = "Cell " & Target.Address(False, False) &
" has been modified on " &
Format(Date, "dd mmm yyyy"
End Wit
End I

ws_exit
Application.EnableEvents = Tru
End Su


--

HT

Bob Phillip
... looking out across Poole Harbour to the Purbeck
(remove nothere from the email address if mailing direct

"myBasic" wrote in messag
..
Hi Bob
Your code works fine, thanks
But how to apply the code to following rows, ie, let's illustrate with th

code
If Not Intersect(Target, Me.Range("A1")) Then change Cell A2 value.

If Not Intersect(Target, Me.Range("B1")) Then change Cell B2 value.
If Not Intersect(Target, Me.Range("C1")) Then change Cell C2 value.
If Not Intersect(Target, Me.Range("D1")) Then change Cell D2 value.
..
thanks
----- Bob Phillips wrote: ----

Here is some cod
Private Sub Worksheet_Change(ByVal Target As Range
On Error GoTo ws_exit

Application.EnableEvents = Fals
If Not Intersect(Target, Me.Range("A1")) Is Nothing The
With Targe
.Offset(0, 1).Value = "Cell "

Target.Address(False,False) &
" has been modified on " &
Format(Date, "dd mmm yyyy"
End Wit
End I
ws_exit

Application.EnableEvents = Tru
End Su
'This is worksheet event code, which means that it needs to b

'placed in the appropriate worksheet code module, not a standar
'code module. To do this, right-click on the sheet tab, selec
'the View Code option from the menu, and paste the code in
--

HT
Bob Phillip

... looking out across Poole Harbour to the Purbeck
(remove nothere from the email address if mailing direct
"myBasic" wrote in messag

..
Hello everybody
I am new in Excel macro programming
Is there any ways to fill some words "remarks" into Cell B2 i

Eece
worksheet, in case Cell A1 value has been modified. I don't know ho

t
inplement the actual Excel macro code but using pseudocode t

represent m
meaning, say
in Cell B, fill formula
= If cells('A1').value != originalValue The

cells('B1').value = "Cell A1 has been modified on " & Date(
End I
Kindly tell how to convert the above meaning into extual Exce

macro code
Thanks & regards




  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default Alter one cell value, in case another cell's value changed

It's a pleasure.

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"myBasic" wrote in message
...
It works fine, thank you, Bob.


----- Bob Phillips wrote: -----

Private Sub Worksheet_Change(ByVal Target As Range)

On Error GoTo ws_exit:
Application.EnableEvents = False
If Not Intersect(Target, Me.Range("A1,B1,C1,D1")) Is Nothing Then
With Target
.Offset(1, 0).Value = "Cell " & Target.Address(False,

False) & _
" has been modified on " & _
Format(Date, "dd mmm yyyy")
End With
End If

ws_exit:
Application.EnableEvents = True
End Sub


--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"myBasic" wrote in message
...
Hi Bob,
Your code works fine, thanks.
But how to apply the code to following rows, ie, let's illustrate

with the
code.
If Not Intersect(Target, Me.Range("A1")) Then change Cell A2

value..
If Not Intersect(Target, Me.Range("B1")) Then change Cell B2

value..
If Not Intersect(Target, Me.Range("C1")) Then change Cell C2

value..
If Not Intersect(Target, Me.Range("D1")) Then change Cell D2

value..
...
thanks.
----- Bob Phillips wrote: -----
Here is some code
Private Sub Worksheet_Change(ByVal Target As Range)
On Error GoTo ws_exit:

Application.EnableEvents = False
If Not Intersect(Target, Me.Range("A1")) Is Nothing Then
With Target
.Offset(0, 1).Value = "Cell " &

Target.Address(False,False) & _
" has been modified on " & _
Format(Date, "dd mmm yyyy")
End With
End If
ws_exit:

Application.EnableEvents = True
End Sub
'This is worksheet event code, which means that it needs to

be
'placed in the appropriate worksheet code module, not a

standard
'code module. To do this, right-click on the sheet tab, select
'the View Code option from the menu, and paste the code in.
--
HTH
Bob Phillips

... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)
"myBasic" wrote in

message
...
Hello everybody,
I am new in Excel macro programming.
Is there any ways to fill some words "remarks" into Cell B2 in

Eecel
worksheet, in case Cell A1 value has been modified. I don't

know how
to
inplement the actual Excel macro code but using pseudocode to

represent my
meaning, say:
in Cell B, fill formula:
= If cells('A1').value != originalValue Then
cells('B1').value = "Cell A1 has been modified on " & Date()
End If
Kindly tell how to convert the above meaning into extual Excel

macro code.
Thanks & regards.



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
Format changed when the details in cell changed angel Excel Worksheet Functions 9 July 15th 08 12:36 AM
Changing multiple cell text from lower case to upper case Patti Excel Discussion (Misc queries) 2 January 4th 08 08:35 PM
How to determine if a cell's data has been changed aidans Excel Discussion (Misc queries) 3 February 13th 07 03:47 PM
IN EXCEL, HOW DO I ALTER LOWER CASE TO UPPER NOT OVERTYPING kkirstyy Excel Discussion (Misc queries) 1 August 17th 06 02:51 PM
Making a cell's contents lower case KimberlyC Excel Worksheet Functions 4 May 4th 05 11:23 PM


All times are GMT +1. The time now is 11:22 PM.

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

About Us

"It's about Microsoft Excel"