SouthernAngel
New Member
- Joined
- Oct 8, 2018
- Messages
- 1
I am needing assistance with adjusting my combo box to allow the data to update based on the month selected. Currently, it is only pulling data for the day (i.e. if "October" is selected, it is only pulling "10/1/2018")
To start, I have a VBA code below. It inputs data from a spreadsheet into the Data tab on the workbook attached. The VBA code is setup to have the date entered as "mmmm-yyyy" but when inputting on the Data tab, it displays as "October-2018", however it is formatted to input the day the data was entered from another spreadsheet.
On the Overview tab, when October is selected, the idea is to update all the data based on that selectin, however it is only pulling that specific day.
NOTE: I am using October because there were three days of input
How do I setup my Data Validation list to incorporate the month of October?
To start, I have a VBA code below. It inputs data from a spreadsheet into the Data tab on the workbook attached. The VBA code is setup to have the date entered as "mmmm-yyyy" but when inputting on the Data tab, it displays as "October-2018", however it is formatted to input the day the data was entered from another spreadsheet.
On the Overview tab, when October is selected, the idea is to update all the data based on that selectin, however it is only pulling that specific day.
NOTE: I am using October because there were three days of input
How do I setup my Data Validation list to incorporate the month of October?
Code:
Sub CopyData()
Dim i As Long
Dim Rng As Range
Dim Iws As Worksheet, Rws As Worksheet
Set Iws = Sheets("Input")
Set Rws = Sheets("AuditData")
For i = 3 To 11
For Each Rng In Iws.Cells(4, i).Resize(21).SpecialCells(xlConstants).Areas
With Rws.Range("D" & Rows.Count).End(xlUp).Offset(1)
.Value = Rng.Offset(, -i + 1).Value
.Offset(, -3).Resize(, 3).Value = Array(Date, Application.UserName, Iws.Range("J1").Value)
.Offset(, -3).NumberFormat = "mmmm-yyyy"
.Offset(, 1).Value = Iws.Cells(3, i).Value
.Offset(, 2).Resize(, Rng.Count).Value = Application.Transpose(Rng.Value)
.Offset(, 6).FormulaR1C1 = "=AVERAGE(rc6:rc9)"
End With
Next Rng
Next i
End Sub