Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 59
Default Private sub Worksheet change question

I am trying to use a Private Sub Worksheet_Change event macro to change the
value of cell g12 when theres a change to cell a3, and when cell g6 =
1. Cell a3 is itself the cell link of a combo box (created from the
Forms toolbar). I know that this kind of macro only works under some
circumstances, but is this one of them? My code is:

Private Sub worksheet_change(ByVal target As Range)
If Not Intersect(target, Me.Range("a3")) Is Nothing Then
If Range("g6").Value = "1" Then
Range("g12").Value = "8"
End If
End If
End Sub

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,090
Default Private sub Worksheet change question

I removed the quotes around the 1 and the 8 and it works for me. HTH Otto
Private Sub Worksheet_Change(ByVal Target As Range)
If Not Intersect(Target, Me.Range("a3")) Is Nothing Then
If Range("g6").Value = 1 Then
Range("g12").Value = 8
End If
End If
End Sub
"Graeme" wrote in message
...
I am trying to use a Private Sub Worksheet_Change event macro to change the
value of cell "g12" when there's a change to cell "a3", and when cell "g6"
=
1. Cell "a3" is itself the cell link of a combo box (created from the
"Forms" toolbar). I know that this kind of macro only works under some
circumstances, but is this one of them? My code is:

Private Sub worksheet_change(ByVal target As Range)
If Not Intersect(target, Me.Range("a3")) Is Nothing Then
If Range("g6").Value = "1" Then
Range("g12").Value = "8"
End If
End If
End Sub



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 59
Default Private sub Worksheet change question

Thanks for the quick response, however it's still not working on my end. In
your file, is the value of "a3" changing when a combo box selection changes?

"Otto Moehrbach" wrote:

I removed the quotes around the 1 and the 8 and it works for me. HTH Otto
Private Sub Worksheet_Change(ByVal Target As Range)
If Not Intersect(Target, Me.Range("a3")) Is Nothing Then
If Range("g6").Value = 1 Then
Range("g12").Value = 8
End If
End If
End Sub
"Graeme" wrote in message
...
I am trying to use a Private Sub Worksheet_Change event macro to change the
value of cell "g12" when there's a change to cell "a3", and when cell "g6"
=
1. Cell "a3" is itself the cell link of a combo box (created from the
"Forms" toolbar). I know that this kind of macro only works under some
circumstances, but is this one of them? My code is:

Private Sub worksheet_change(ByVal target As Range)
If Not Intersect(target, Me.Range("a3")) Is Nothing Then
If Range("g6").Value = "1" Then
Range("g12").Value = "8"
End If
End If
End Sub




  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,090
Default Private sub Worksheet change question

No. How that value gets into that cell makes no difference unless that cell
contains a formula and that formula generates that value. Otto
"Graeme" wrote in message
...
Thanks for the quick response, however it's still not working on my end.
In
your file, is the value of "a3" changing when a combo box selection
changes?

"Otto Moehrbach" wrote:

I removed the quotes around the 1 and the 8 and it works for me. HTH
Otto
Private Sub Worksheet_Change(ByVal Target As Range)
If Not Intersect(Target, Me.Range("a3")) Is Nothing Then
If Range("g6").Value = 1 Then
Range("g12").Value = 8
End If
End If
End Sub
"Graeme" wrote in message
...
I am trying to use a Private Sub Worksheet_Change event macro to change
the
value of cell "g12" when there's a change to cell "a3", and when cell
"g6"
=
1. Cell "a3" is itself the cell link of a combo box (created from the
"Forms" toolbar). I know that this kind of macro only works under some
circumstances, but is this one of them? My code is:

Private Sub worksheet_change(ByVal target As Range)
If Not Intersect(target, Me.Range("a3")) Is Nothing Then
If Range("g6").Value = "1" Then
Range("g12").Value = "8"
End If
End If
End Sub






  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 59
Default Private sub Worksheet change question

That is how I thought it worked, and when I manually type in a value in cell
"a3", the macro works. However, when the value in "a3" gets changed after I
make a new selection in the associated drop-down box, it does not work. This
is the part that is confusing me.

"Otto Moehrbach" wrote:

No. How that value gets into that cell makes no difference unless that cell
contains a formula and that formula generates that value. Otto
"Graeme" wrote in message
...
Thanks for the quick response, however it's still not working on my end.
In
your file, is the value of "a3" changing when a combo box selection
changes?

"Otto Moehrbach" wrote:

I removed the quotes around the 1 and the 8 and it works for me. HTH
Otto
Private Sub Worksheet_Change(ByVal Target As Range)
If Not Intersect(Target, Me.Range("a3")) Is Nothing Then
If Range("g6").Value = 1 Then
Range("g12").Value = 8
End If
End If
End Sub
"Graeme" wrote in message
...
I am trying to use a Private Sub Worksheet_Change event macro to change
the
value of cell "g12" when there's a change to cell "a3", and when cell
"g6"
=
1. Cell "a3" is itself the cell link of a combo box (created from the
"Forms" toolbar). I know that this kind of macro only works under some
circumstances, but is this one of them? My code is:

Private Sub worksheet_change(ByVal target As Range)
If Not Intersect(target, Me.Range("a3")) Is Nothing Then
If Range("g6").Value = "1" Then
Range("g12").Value = "8"
End If
End If
End Sub









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
Special Private Character Question ram Excel Discussion (Misc queries) 4 July 12th 08 03:28 AM
Question about private subs MLK Excel Programming 4 October 16th 07 01:36 PM
Private Textbox Exit Sub question... [email protected] Excel Worksheet Functions 14 March 1st 07 03:58 AM
Private Function Code Change Phil H[_2_] Excel Programming 5 April 14th 06 02:04 PM
Private Sub Workbook Open() - question Anthony Excel Programming 5 October 11th 05 06:39 PM


All times are GMT +1. The time now is 08:51 AM.

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"