Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 55
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7,247
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 55
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 947
Default 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
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
clean up code a little terilad Excel Discussion (Misc queries) 12 April 12th 10 07:35 PM
help me clean up this code Dave F[_2_] Excel Programming 2 June 14th 07 07:50 PM
Clean Up Code - consolidate steps Frantic Excel-er Excel Discussion (Misc queries) 6 June 30th 05 03:40 PM
Clean up code. Tim Excel Programming 2 October 1st 04 05:37 PM
Help clean up this code... scottnshelly[_32_] Excel Programming 8 June 21st 04 09:30 PM


All times are GMT +1. The time now is 10:38 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"