Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Month
Excel 2000
I have a spreadsheet that posts production to a column labeled by mont (ie Jan03, Feb 03 etc.) In the macro I am using code similar to " Rang ("C3").select " to paste the data to the proper column. At the first o the month I have to change the code to designate the new month starting cell ( "C3" changes to "D3"). Is there a way to automate this to change without having to change th macro every month -- Message posted from http://www.ExcelForum.com |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
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/ |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
excel to make the days cary over month to month automaticly | New Users to Excel | |||
Excel 2003 month to month data change grid | Excel Discussion (Misc queries) | |||
Retrieve data for previous 3, 6, 12 month given current month | Excel Worksheet Functions | |||
Converting Month Number to Month Text Abbreviation | Excel Worksheet Functions | |||
transfer cell $ amount to other sheet month-to-month without overc | Excel Discussion (Misc queries) |