#1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default 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   Report Post  
Posted to microsoft.public.excel.programming
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/

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
excel to make the days cary over month to month automaticly GARY New Users to Excel 1 April 19th 08 06:05 PM
Excel 2003 month to month data change grid Chad[_2_] Excel Discussion (Misc queries) 2 February 15th 08 01:36 AM
Retrieve data for previous 3, 6, 12 month given current month GB Excel Worksheet Functions 4 July 19th 07 11:58 PM
Converting Month Number to Month Text Abbreviation Bob Excel Worksheet Functions 10 May 12th 07 04:11 AM
transfer cell $ amount to other sheet month-to-month without overc Colin2u Excel Discussion (Misc queries) 1 July 28th 05 02:36 AM


All times are GMT +1. The time now is 07:27 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"