VBA How to extract last date and timestamp into input box Greater than?

vbanewbie68

Board Regular
Joined
Oct 16, 2021
Messages
171
Office Version
  1. 365
Platform
  1. Windows
  2. MacOS
Hello

I wondered if I could ask for a few minutes of your time, I need some help and advice. Please see my attached images the Destination and Source workbook.

When I ran a macro, I get a prompt inputbox message as this ‘Greater Than Date’, which is fine. I have manually enter the lastest/max UTC date and timestamp from the other workbook.

I would like to know how to automatically extract the lastest date (UTC date and timestamp format) from the other workbook (source) and then put this nto the inputbox. This will save a lot of time.

I hope this make sense, if not just give me a shout if not.

Thank you in advance.

Vbanewbie68

Please see my codes.

Sub deleterows()
lastrow = Cells(Rows.Count, 7).End(xlUp).Row
GreaterDate = Application.InputBox("Greater Than Date")

For i = lastrow To 2 Step -1
If Cells(i, 7).Value < GreaterDate Then Rows(i).EntireRow.Delete
Next i
End Sub
 

Attachments

  • Workbook destination.PNG
    Workbook destination.PNG
    228.8 KB · Views: 7
  • Capture2.PNG
    Capture2.PNG
    198.6 KB · Views: 9

Excel Facts

When they said...
When they said you are going to "Excel at life", they meant you "will be doing Excel your whole life".

Forum statistics

Threads
1,214,987
Messages
6,122,618
Members
449,092
Latest member
amyap

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