Creating a Specific Formula or Macro

gvp

New Member
Joined
Sep 18, 2006
Messages
1
I was wondering if anybody could help. I am creating a spreadsheet for a football pool that me and my friends participate in each week of the nfl season. What I am having trouble with is I would like to have a list of each nfl team playing that week, with the table of everybody's picks for that given week. In the list of the teams on the side of the table, I would like to highlight the winning team of each game once, then it would go through the table and highlight that team automatically every time it appears in the table, so I don't have to highlight each box individually where it appears. So, say if Pittsburgh wins, i could highlight Pittsburgh once, then everyone who picked Pittsburgh would automatically have their Pittsburgh box highlighted in the same color Pittsburgh was highlighted in in my teams list. I hope I explained this right and thanks in advance for any help any of you might be able to lend!
 

Excel Facts

What is the shortcut key for Format Selection?
Ctrl+1 (the number one) will open the Format dialog for whatever is selected.

venkat1926

Well-known Member
Joined
Aug 21, 2005
Messages
4,824
I dont know how you have confitgured your spreadsheet data.
below is a sample spred sheet and correpsonding macro
this is an event code.
after introducing the macro you have only to
slect any entry in colum Iand the corresponding row in the table columns A to D is slected . you need not run any mcro it automatically does once you select any entry in column I.


righclick the spreadhset tab and clik view code.
on theleft side window ararow click and choose worksheet.
automacicall the follwing line will come up on default

Private Sub Worksheet_SelectionChange(ByVal Target As Range)



end sub

in between copy or type these code staements.
(modify the code statments to suit your)

Code:
Dim x As String
If Target.Column<> 9 Then Exit Sub
'9 is the number of column I
x = Target.Value
Dim cfind As Range
With Columns("A:D")
Set cfind = .Find(x, lookat:=xlWhole)
End With
Range(cfind, cfind.End(xlToRight)).Select

the sample sheet is below
Book1
ABCDEFGHI
1teamthosewhopickedtheteamteam
2axcva
3scvs
4dvd
5ffcf
6gbg
Sheet1
 

Forum statistics

Threads
1,136,423
Messages
5,675,765
Members
419,585
Latest member
popsin

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Top