Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default Event Procedure

3 4 7 7 8 8 8 8 8 8 Band A A A B C C C E 0
3 1 3 0 1 0 0 0 0 0 Offset 1 1 1 2 3 3 3 5 ###
Distribution
A
B C D E F G H I J 13 7 7 7 20 8 7 9
A B C D E F G H I J
1 1 1 1 1 1 1 1 1 1 13 7 7 7 20 8 7 9

Hi,
Im trying with little sucess to write an procedure, that when a value "1" is
entered in the cell below the blue A, a match is performed with the "A" in
blue against the white A A A B CC....Row, for each match a formula must be
entered , in the corresponding row the "1" was entered. The same procedure
will run for B C D etc when a 1 is entered.

Many Thanks

Paul


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Event Procedure

This assumes the A A A B C C C E 0
is in row 1 starting in F1

Private Sub Worksheet_Change(ByVal Target As Range)
Dim rng As Range, cell As Range
Dim rw As Range
If Target.Count 1 Then Exit Sub
If Target.Value = 1 Then
Application.EnableEvents = False
On Error GoTo ErrHandler
sTarget = Target.Offset(-1, 0).Value
rw = Target.Row
Set rng = Range("F1:N1")
For Each cell In rng
If cell.Value = sTarget Then
Cells(rw, cell.Column).Formula = "=Trunc(rand()*100+1)"
End If
Next
End If
ErrHandler:
Application.EnableEvents = True
End Sub

Right click on the sheet Tab, select view code and paste in the code.
Replace my formula with whatever formula you want.

--
Regards,
Tom Ogilvy
"Paul Johnson" wrote in message
...
3 4 7 7 8 8 8 8 8 8 Band A A A B C C C E 0
3 1 3 0 1 0 0 0 0 0 Offset 1 1 1 2 3 3 3 5 ###
Distribution
A
B C D E F G H I J 13 7 7 7 20 8 7 9
A B C D E F G H I J
1 1 1 1 1 1 1 1 1 1 13 7 7 7 20 8 7 9

Hi,
Im trying with little sucess to write an procedure, that when a value "1"

is
entered in the cell below the blue A, a match is performed with the "A" in
blue against the white A A A B CC....Row, for each match a formula must be
entered , in the corresponding row the "1" was entered. The same

procedure
will run for B C D etc when a 1 is entered.

Many Thanks

Paul




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
workbook_Open event Procedure peerless Excel Discussion (Misc queries) 1 May 22nd 06 10:21 PM
change event procedure benb Excel Programming 2 September 24th 04 09:22 PM
programming the VBE for a new event procedure mark kubicki Excel Programming 3 August 18th 04 04:43 PM
Event Procedure Programming Jeff Armstrong Excel Programming 1 July 29th 04 03:54 PM
OnTime event not firing in Workbook_Open event procedure GingerTommy Excel Programming 0 September 24th 03 03:18 PM


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