Consolidate/ Clean-Up Some Code

E

Exceller

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"
 
C

Chip Pearson

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)
 
E

Exceller

Thanks, Chip. I appreciate your help.


Chip Pearson said:
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)
 
D

Dana DeLouis

Just another...

Sub Demo()
ActiveCell.Resize(1, 12) = Application.GetCustomListContents(4)
End Sub

= = =
HTH :>)
Dana DeLouis
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top