Hello I have this worksheet.
Sample Data from "Demand Planning Prem" worksheet
<tbody>
</tbody>
This worksheet has around 40,000 records, and I need to create a Macro that will ask the user for a date, and when the user enters a date the macro goes through column A and finds all of the matching dates and then replaces the numbers (along with the formulas) in the corresponding Add Returns cells (column E) with 0's.
I have only been able to create an inputbox, but I am completely lost regarding the criteria due to being very new to VBA.
Sub ClearData()
Dim EnterDate As Date
Dim msg As String
msg = "Please enter a date in the mm/dd/yyyy format"
EnterDate = Inputbox(msg)
ActiveSheet.Range("A")
If EnterDate = Range("A") Then
Range("E") = 0
End if
End Sub
Sample Data from "Demand Planning Prem" worksheet
Date | SKU | Name | Begin FG's | Add Returns | Demand FG | End FG's | Weeks FG | Excess FG |
6/20/2014 | ASDRK-301 | Tent | 5718 | 1 | 58 | 5661 | 98 | 5339 |
6/27/2014 | ASDRK-301 | Tent | 5661 | 7 | 36 | 5632 | 156 | 5310 |
7/4/2014 | ASDRK-301 | Tent | 5632 | 4 | 38 | 5598 | 147 | 5276 |
7/11/2014 | ASDRK-301 | Tent | 5598 | 7 | 38 | 5560 | 146 | 5238 |
7/18/2014 | ASDRK-301 | Tent | 5560 | 5 | 38 | 5522 | 145 | 5200 |
8/1/2014 | ASDRK-301 | Tent | 5522 | 2 | 38 | 5484 | 144 | 5162 |
8/1/2014 | ASDRK-301 | Canoe | 5484 | 7 | 38 | 5446 | 143 | 5124 |
8/8/2014 | ASDRK-301 | Canoe | 5446 | 9 | 38 | 5408 | 142 | 5086 |
<tbody>
</tbody>
This worksheet has around 40,000 records, and I need to create a Macro that will ask the user for a date, and when the user enters a date the macro goes through column A and finds all of the matching dates and then replaces the numbers (along with the formulas) in the corresponding Add Returns cells (column E) with 0's.
I have only been able to create an inputbox, but I am completely lost regarding the criteria due to being very new to VBA.
Sub ClearData()
Dim EnterDate As Date
Dim msg As String
msg = "Please enter a date in the mm/dd/yyyy format"
EnterDate = Inputbox(msg)
ActiveSheet.Range("A")
If EnterDate = Range("A") Then
Range("E") = 0
End if
End Sub