View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
Don Guillett Don Guillett is offline
external usenet poster
 
Posts: 10,124
Default Some VB coding required

right click sheet tabview codeinsert thisSAVE

Private Sub Worksheet_Change(ByVal Target As Range)
Range(Cells(3, 1), Cells(Rows.Count, 1)) _
.EntireRow.Hidden = True
mv = Range("a2")
mymonth = Month(DateValue(mv & " 1, 2006")) - 4
sr = 3 + (41 * mymonth) - mymonth * 2
er = 41 + (39 * mymonth)
Range(Cells(sr, 1), Cells(er, 1)) _
.EntireRow.Hidden = False
End Sub


--
Don Guillett
SalesAid Software

"ExcelBob" wrote in
message ...

basically i want

all rows on a worksheet hidden (except rows 1 & 2)
default in a2 to be "april" (so it doesn't allow a blank)

if cell a2 = "april" show rows 3:41
if cell a2 = "may" show rows 42:80
if cell a2 = "june" show rows 81:11

etc

any magicians out there?


--
ExcelBob
------------------------------------------------------------------------
ExcelBob's Profile:
http://www.excelforum.com/member.php...o&userid=34152
View this thread: http://www.excelforum.com/showthread...hreadid=545465