» 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:
- The Essential 55: An Award-Winning Educator's Rules for Discovering the Successful Student in Every Child
- Marketing Planning for Services
- Guide to Financial Reporting and Analysis
- A Mathematician Plays the Stock Market
- Microsoft Office Xp: Advanced Concepts and Techniques: Word 2002, Excel 2002, Access 2002, Powerpoint 2002
- Positioning: The Battle for Your Mind
No comments have been submitted.

