There's no need to do it each and every time. The first thing to note is that you populate the combo boxes each time they're clicked. XlOpenXMLWorkbookMacroEnabled, CreateBackup:=False Selection.AutoFill Destination:=Range(Cells(4, 5), Cells(4, 5 Selection.AutoFill Destination:=Range(Cells(4, 3), Cells(4, 3 Selection.AutoFill Destination:=Range(Cells(5, 3), Cells(5, 3 Selection.AutoFill Destination:=Range(Cells(6, 2), Cells(6, 2
Sheets(Array("Daily Sales", "Total Inventory", "Deliveries", "Income StartDate = CDate("1-" & CmboMonth.Value & "-" & CmboYear.Value)ĭays = (DateDiff("d", StartDate, DateAdd("m", 1, StartDate))) - 1 You will note that I have relied extensively on Macro Recorder, because I am VERY new to VBA.
#Dailysales com review code
This code works however, it is extremely clumsy and long-winded. I got help on the CmdEnter_Click portion of this code from StackOverflow. I have created this macro that will take this generic sheet and, based on an input of month and year, will generate a new monthly sheet which will autopopulate the dates across the top of the sheet, and will delete the columns that are not necessary based on the number of days in the month. The cells inside the various sheets are pre-populated with formulas for calculating total inventory, income and net profits based on deliveries and daily sales. I have generated a "generic" master document where I have pre-entered the items for sale in Column A, and then left 31 pre-formatted spaces for dates across the top. The general conditions of the document are that it has to be easy to use, because the people who are using it are not very computer literate. I have created an inventory management sheet for a Lodge in Africa.