Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Auto fill?? Help??

I have in a column a range of cells label tyke #1 thru to
Tyke # 8 (A2:A9) columns (B1:CE1) are labelled as days of
the week. the range (B2:CE9) is the schedule for the teams
I would like that when I enter "P2" in any column (b1:ce1)
on row A2 that it automatically know to put "P1" in row A3
and if I enter "H3" in row A8 it automatically puts "G7" in
row A4 and vice versa. Basically as soon as I enter either
"P1-8" or "H1-8" or "G1-8" in any cell with the
range(B2:CE9) it will put the corresponding entry in the
same column. (note; no team can practice or play against
itself) I have a spread sheet with over 4000 games
practices to do and if someone out there knows how to do
this ican modify it to make it work for all levels that i
hae to schedule. thanks
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 599
Default Auto fill?? Help??

Herman


I have in a column a range of cells label tyke #1 thru to
Tyke # 8 (A2:A9) columns (B1:CE1) are labelled as days of
the week.


Like Monday, Tuesday, Wednesday, or actual dates/

the range (B2:CE9) is the schedule for the teams
I would like that when I enter "P2" in any column (b1:ce1)
on row A2 that it automatically know to put "P1" in row A3
and if I enter "H3" in row A8 it automatically puts "G7" in
row A4 and vice versa.


Please explain. Does P stand for practice and G for game? If so, what is
H? I assume by entering P2, that means that Tyke#2 is the other side and
you want the corresponding entry on their row. Why then would you put P1 on
row 3? Wouldn't you want Px where x is the team on whose row you're
entering? And why if you enter H3, would it put G7 and not H7?

Basically as soon as I enter either
"P1-8" or "H1-8" or "G1-8" in any cell with the
range(B2:CE9) it will put the corresponding entry in the
same column. (note; no team can practice or play against
itself) I have a spread sheet with over 4000 games
practices to do and if someone out there knows how to do
this ican modify it to make it work for all levels that i
hae to schedule. thanks


This looks like 82 columns and 8 rows which would be 656 games, not 4000, so
I'm a little confused on that point.

If all my assumptions are correct, then try this. Right click on sheet tab
and choose View Code, then paste this in the code window that pops up. Let
me know if it's even close.

Private Sub Worksheet_Change(ByVal Target As Range)

Dim OtherRow As Long
Dim ThisTeam As Long
Dim cell As Range

Application.EnableEvents = False

'Only cells in the right range
If Not Intersect(Target, Me.Range("B2:CE9")) Is Nothing Then

'If cell is deleted
If Not IsEmpty(Target) Then

'Make sure you enter the right format
If Target.Value Like "[G,H,P]#" Then

OtherRow = CLng(Right(Target.Value, 1)) + 1
ThisTeam = Target.Row - 1

With Me.Cells(OtherRow, Target.Column)
If IsEmpty(.Item(1)) Then
.Value = Left(Target.Value, 1) & ThisTeam
Else
MsgBox "Team " & Me.Cells(OtherRow, 1).Value & _
" is already scheduled"
Target.ClearContents
End If
End With
Else
MsgBox "Invalid entry"
Target.ClearContents
End If
Else
For Each cell In Intersect(Target.EntireColumn, _
Me.Range("b2:CE9")).Cells

If Right(cell.Value, 1) = CStr(Target.Row - 1) Then
cell.ClearContents
Exit For
End If
Next cell
End If
End If

Application.EnableEvents = True

End Sub
--
Dick Kusleika
MVP - Excel
www.dicks-clicks.com
Post all replies to the newsgroup.


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
auto fill or auto search from a list or drop-down list??????? Joe H.[_2_] Excel Discussion (Misc queries) 9 August 29th 08 12:56 AM
Auto-populate, Auto-copy or Auto-fill? Jay S. Excel Worksheet Functions 4 August 10th 07 09:04 PM
Auto Fill Mary jane Excel Discussion (Misc queries) 3 January 19th 07 08:37 PM
using auto fill edit or fill handel fill handle or auto fill Excel Worksheet Functions 0 February 10th 06 07:01 PM
Auto Fill Jay Excel Discussion (Misc queries) 1 January 28th 06 07:46 PM


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