swap for input box

kenpcli

Board Regular
Joined
Oct 24, 2017
Messages
129
This what I have, but I need the person running to be able to input the newest date in place of the highlighted portion:

LastRow = Range("B" & Rows.Count).End(xlUp).Row
Range("F2:F" & Range("F" & Rows.Count).End(xlUp).Row).Formula = "=IF(ISNA(VLOOKUP(C2,'12-31 TO 01-06'!$C$1:$F$500,4,FALSE)),""NONE"",VLOOKUP(C2,'01-07 TO 01-13'!$C$1:$F$500,4,FALSE))"
Range("F2").AutoFill Destination:=Range("F2:F" & LastRow)
For Q = 1 To Cells(Rows.Count, "F").End(xlUp).Row
If Cells(Q, "F").Value = "NONE" Then Cells(Q, "F").Interior.ColorIndex = 15
Next
 

Excel Facts

Fastest way to copy a worksheet?
Hold down the Ctrl key while dragging tab for Sheet1 to the right. Excel will make a copy of the worksheet.
This what I have, but I need the person running to be able to input the newest date in place of the highlighted portion:

LastRow = Range("B" & Rows.Count).End(xlUp).Row
Range("F2:F" & Range("F" & Rows.Count).End(xlUp).Row).Formula = "=IF(ISNA(VLOOKUP(C2,'12-31 TO 01-06'!$C$1:$F$500,4,FALSE)),""NONE"",VLOOKUP(C2,'01-07 TO 01-13'!$C$1:$F$500,4,FALSE))"
Range("F2").AutoFill Destination:=Range("F2:F" & LastRow)
For Q = 1 To Cells(Rows.Count, "F").End(xlUp).Row
If Cells(Q, "F").Value = "NONE" Then Cells(Q, "F").Interior.ColorIndex = 15
Next
What do you mean by "newest date"? The highlighted part of your code has two dates separated by the word "TO" and a couple of spaces.
 
Upvote 0
What do you mean by "newest date"? The highlighted part of your code has two dates separated by the word "TO" and a couple of spaces.

The first date is the first worksheet and the one highlighted in red is the newest worksheet inserted. Instead of having to change the date to the newest worksheet I wanted the user to be able to just input the date and it automatically update the macro.
 
Upvote 0
so instead of someone having to change it 1/1/18 TO 1/7/18 they could just use the input box.
 
Upvote 0

Forum statistics

Threads
1,224,883
Messages
6,181,551
Members
453,052
Latest member
ezzat

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top