ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Some VB coding required (https://www.excelbanter.com/excel-programming/362412-some-vbulletin-coding-required.html)

ExcelBob[_4_]

Some VB coding required
 

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

--
ExcelBo
-----------------------------------------------------------------------
ExcelBob's Profile: http://www.excelforum.com/member.php...fo&userid=3415
View this thread: http://www.excelforum.com/showthread.php?threadid=54546


ExcelBob[_5_]

Some VB coding required
 

No wizards 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


Don Guillett

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




Don Guillett

Some VB coding required
 
patience is a virtue

--
Don Guillett
SalesAid Software

"ExcelBob" wrote in
message ...

No wizards 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





All times are GMT +1. The time now is 02:40 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com