Solved

populat days of month

Posted on 2014-09-17
3
68 Views
Last Modified: 2014-10-06
I would like to populate the days ot the month to the right of l5 based on user input.the most efficient and quicket way.
thankss
Book1dates.xlsm
0
Comment
Question by:Svgmassive
3 Comments
 
LVL 24

Accepted Solution

by:
Phillip Burton earned 250 total points
ID: 40327670
Please find attached.
Book1dates.xlsm
0
 

Author Comment

by:Svgmassive
ID: 40327713
can we also do in vba.thanks
0
 
LVL 27

Assisted Solution

by:Glenn Ray
Glenn Ray earned 250 total points
ID: 40328622
Add this code to the Sheet object in VBA:
Option Explicit
Dim c As Integer
Private Sub Worksheet_Change(ByVal Target As Range)
    If Target.Address = "$L$5" Then 'show dates for month
        For c = 0 To 30
            If Month(Target.Value + c) = Month(Target.Value) Then
                Target.Offset(0, c + 1).Value = Target.Value + c
            Else
                Target.Offset(0, c + 1).Value = ""
            End If
        Next c
    End If
End Sub

Open in new window


It will populate the cells to the right, starting with the data specified in cell L5, to the last day of the month.  It does not check that the date in L5 is ACTUALLY the first date of the month.

Example file attached.

-Glenn
EE-Book1dates.xlsm
0

Featured Post

Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Excel VBA - macro in one workbook with another open 4 19
Excel Formula 5 43
Alphabetical Order for Letters 2 21
VBA Works in Excel 2010 Not 2016 Help! 5 17
Drop Down List with Unique/Distinct Values (Part II - ComboBox or ListBox and Data Validation List Bonus!) David Miller (dlmille) Intro This article focuses on delivering unique, sorted lists to list objects (e.g., ComboBox, ListBox) and Dat…
Convert between Excel file formats (.XLS, .XLSX, .XLSM) with/without macro option David Miller (dlmille) Intro Over this past Fall, I've had the opportunity to see several similar requests and have developed a couple related solutions associate…
The viewer will learn how to use the =DISCRINV command to create a discrete random variable, use this command to model a set of probabilities and outcomes in a Monte Carlo simulation, and learn how to find the standard deviation of a set of probabil…
This Micro Tutorial will demonstrate how to use longer labels with horizontal bar charts instead of the vertical column chart.

785 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question