目前我正在尝试将变量声明为我从excel中的工作表中提取的日期,然后使用该声明的日期作为基准,以便我可以删除大于它的所有内容.我认为我的代码对于这个任务是可靠的,但我一直有的问题是当我查看我的日期被宣布为而不是2015年1月12日,因为它应该在凌晨12:00:00出现并且它取代了我从中提取日期的单元格的内容.这是我到目前为止的代码......
Sub Remove_Unecessary_Data_1()
Dim ALLCs As Worksheet
Dim DS As Worksheet
Dim Dailystring As String
Dim Blank As String
Dim finaldate As Date
Dailystring = " - Daily"
Blank = ""
Set DS = Sheets("Data Summary")
Set ALLCs = Sheets("Asset LLC (Input)")
ALLCs.Select
For y = 1 To 40
If InStr(1, Allcs.Cells(13, y), "Timestamp of Execution") Then
finaldate = Allcs.Cells(50, y)
End If
Next
ALLCs.Select
For u = 1 To 40
If InStr(1, Allcs.Cells(13, u), "Start Date") Then
For p …Run Code Online (Sandbox Code Playgroud)