Thread: Month
View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Colo[_16_] Colo[_16_] is offline
external usenet poster
 
Posts: 1
Default Month

Hi, assume row 1 has month name like Jan 03, Feb 03...


Code:
--------------------

Sub Test()
Dim buf
Dim strMonth As String
Dim i As Long
Dim rngStart As Range

'Get name of month from CustomList
buf = Application.GetCustomListContents(3)
strMonth = buf(Month(Date)) & "*"

For i = 1 To Cells(1, 256).End(xlToLeft).Column
If Cells(1, i).Value Like strMonth Then
Set rngStart = Cells(3, i)
Exit For
End If
Next

MsgBox rngStart.Address

' Use rngStart instead of ge ("C3").select
End Sub

--------------------



---
Message posted from http://www.ExcelForum.com/