» Open data in two dimensional array and save in sheet using VBA in Microsoft Excel
CATEGORY - General Topics in VBA
VERSION - All Microsoft Excel Versions
The weekdays and dates of a month are to be opened in a two-dimensional array and then inserted in the sheet
Answer:
Place the code below into the standard module.
Sub dayarray()
Dim arrDay(1 To 31, 1 To 2) As Variant
Dim intCounter As Integer
For intCounter = 1 To 31
arrDay(intCounter, 2) = DateSerial(Year(Date), 12, intCounter)
arrDay(intCounter, 1) = Format(arrDay(intCounter, 2), "dddd")
Next intCounter
Range("A1:B31").Value = arrDay
End Sub
Book Store:
Recommended Books:
- Who Moved My Cheese? An Amazing Way to Deal with Change in Your Work and in Your Life
- The Intelligent Investor: The Classic Bestseller on Value Investing
- Microsoft Access Version 2002 Step by Step
- East of Eden (Oprah's Book Club)
- Microsoft Excel 2002 Simply Visual
- Good to Great: Why Some Companies Make the Leap... and Others Don't
No comments have been submitted.


