Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Consolidate/ Clean-Up Some Code
How do I consolidate this? Thanks.
.Offset(1, 0).Value = "January" .Offset(1, 1).Value = "February" .Offset(1, 2).Value = "March" .Offset(1, 3).Value = "April" .Offset(1, 4).Value = "May" .Offset(1, 5).Value = "June" .Offset(1, 6).Value = "July" .Offset(1, 7).Value = "August" .Offset(1, 8).Value = "September" .Offset(1, 9).Value = "October" .Offset(1, 10).Value = "November" .Offset(1, 11).Value = "December" |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Consolidate/ Clean-Up Some Code
Try something like
Dim N As Long For N = 0 To 11 Range("A1").Offset(1, N).Value = _ Format(DateSerial(2000, N + 1, 1), "mmmm") Next N Cordially, Chip Pearson Microsoft MVP Excel Product Group Pearson Software Consulting, LLC www.cpearson.com (email on web site) On Sun, 7 Dec 2008 17:26:03 -0800, Exceller wrote: How do I consolidate this? Thanks. .Offset(1, 0).Value = "January" .Offset(1, 1).Value = "February" .Offset(1, 2).Value = "March" .Offset(1, 3).Value = "April" .Offset(1, 4).Value = "May" .Offset(1, 5).Value = "June" .Offset(1, 6).Value = "July" .Offset(1, 7).Value = "August" .Offset(1, 8).Value = "September" .Offset(1, 9).Value = "October" .Offset(1, 10).Value = "November" .Offset(1, 11).Value = "December" |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Consolidate/ Clean-Up Some Code
Thanks, Chip. I appreciate your help. "Chip Pearson" wrote: Try something like Dim N As Long For N = 0 To 11 Range("A1").Offset(1, N).Value = _ Format(DateSerial(2000, N + 1, 1), "mmmm") Next N Cordially, Chip Pearson Microsoft MVP Excel Product Group Pearson Software Consulting, LLC www.cpearson.com (email on web site) On Sun, 7 Dec 2008 17:26:03 -0800, Exceller wrote: How do I consolidate this? Thanks. .Offset(1, 0).Value = "January" .Offset(1, 1).Value = "February" .Offset(1, 2).Value = "March" .Offset(1, 3).Value = "April" .Offset(1, 4).Value = "May" .Offset(1, 5).Value = "June" .Offset(1, 6).Value = "July" .Offset(1, 7).Value = "August" .Offset(1, 8).Value = "September" .Offset(1, 9).Value = "October" .Offset(1, 10).Value = "November" .Offset(1, 11).Value = "December" |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Consolidate/ Clean-Up Some Code
Just another...
Sub Demo() ActiveCell.Resize(1, 12) = Application.GetCustomListContents(4) End Sub = = = HTH :) Dana DeLouis Exceller wrote: Thanks, Chip. I appreciate your help. "Chip Pearson" wrote: Try something like Dim N As Long For N = 0 To 11 Range("A1").Offset(1, N).Value = _ Format(DateSerial(2000, N + 1, 1), "mmmm") Next N Cordially, Chip Pearson Microsoft MVP Excel Product Group Pearson Software Consulting, LLC www.cpearson.com (email on web site) On Sun, 7 Dec 2008 17:26:03 -0800, Exceller wrote: How do I consolidate this? Thanks. .Offset(1, 0).Value = "January" .Offset(1, 1).Value = "February" .Offset(1, 2).Value = "March" .Offset(1, 3).Value = "April" .Offset(1, 4).Value = "May" .Offset(1, 5).Value = "June" .Offset(1, 6).Value = "July" .Offset(1, 7).Value = "August" .Offset(1, 8).Value = "September" .Offset(1, 9).Value = "October" .Offset(1, 10).Value = "November" .Offset(1, 11).Value = "December" |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
clean up code a little | Excel Discussion (Misc queries) | |||
help me clean up this code | Excel Programming | |||
Clean Up Code - consolidate steps | Excel Discussion (Misc queries) | |||
Clean up code. | Excel Programming | |||
Help clean up this code... | Excel Programming |