Solved

populat days of month

Posted on 2014-09-17
3
66 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
Comment Utility
Please find attached.
Book1dates.xlsm
0
 

Author Comment

by:Svgmassive
Comment Utility
can we also do in vba.thanks
0
 
LVL 27

Assisted Solution

by:Glenn Ray
Glenn Ray earned 250 total points
Comment Utility
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

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Introduction This Article is a follow-up to my Mappit! Addin Article (http://www.experts-exchange.com/A_2613.html), it was inspired by an email posting I made to EUSPRIG (http://www.eusprig.org/index.htm), I will briefly cover: 1) An overvie…
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…
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…

744 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now