Dec 7, 2019 06:10
@Eidrizi,,, that's great,, if you feel the code I've posted in useful to you then you may accept it as Answer as well up vote also,, and keep asking ☺
Dec 6, 2019 10:34
@Eidrizi and in your code also, you are exporting to the Sheet not to Text file !!
Dec 6, 2019 10:32
@Eidrizi,, using Excel Sheet would be better then Text file ,, cozz if at any point you want to use the copied data then again you need to works hard Cozzz Text file will drop as CSV ,, but choice is yours!!
Dec 6, 2019 10:30
@Eidrizi,, its should any ALSO put File path here ,, ActiveWorkbook.SaveAs "Your Path Here\" like ActiveWorkbook.SaveAs "C:\My Folder\"
Dec 6, 2019 10:05
@Eidrizi,, now check my post I've posted a complete code includes the specific Range to Copy,, hope this work for you!
Dec 6, 2019 09:57
@Eidrizi ,, or you change Workbook name with U have already in the folder!!
Dec 6, 2019 09:55
@Eidrizi this code will work properly no issue, is been tested BUT you need this Workbooks,, Source.XLsx & Export.bat in same folder !!
Dec 6, 2019 09:53
You may try this,, Workbooks("Source.xlsx").Worksheets("Sheet1").Range("A2:D16"‌​).Copy _ Workbooks("Export.bat").Worksheets("Sheet1").Range("A2") ,, hope this help you!
Dec 6, 2019 09:53
@Eidrizi ,, are you exporting /Copying Sheet data to new Workbook or to Text File?
Dec 6, 2019 09:53
@Eidrizi,, please write how many Columns & Rows you want to COPY as BAT file !
Dec 6, 2019 09:53
I guess you have Headers in Row 1 ,, if so then skip Row 1,, write Range("A2").Select.
 
Oct 14, 2019 10:23
@Synik,, may be some other characters around difficult to say the reason since not having actual data to test may be some extra space around ,,,look if is working with 20 Rows mean the method is correct!
Oct 14, 2019 10:20
or use this R~ * is R~ <SAPCE>then * sign
Oct 14, 2019 10:16
@Synik,, yeah it's R~ then put space from Keyboard !!
Oct 14, 2019 10:09
@Synik ,, look at my end what I've suggested you are properly working ,,, I've tested then posted the solutions,,, unfortunately you are still in trouble!!
Oct 14, 2019 10:07
@Synik,, if it's the text Please specify your need in language R I've used Begins with option like R~<sapce> (R followed by ~ symbol then followed by SPACE) ,, Filters R,, look sometimes you need to adjust with TEXT or Characters around the TEXT!!
Oct 14, 2019 10:07
@Synik,, check the edited part !!
Oct 14, 2019 10:07
@Synik,, in which Column you want to apply Filter Position, Company or Description !!
 
Aug 19, 2019 11:59
@JvdV it's the best way to settle down ,,, ☺
Aug 19, 2019 11:57
@JvdV,,, it's not only CLOSEST but is CLOSEST but BEFORE,,,
Aug 19, 2019 11:56
@JvdV,, let me say one good thing,,, we both tried the issue in our way and what would be better,, wait for the OP & others to decide,,
Aug 19, 2019 11:54
Closest but Before,,,, the Date is the text
Aug 19, 2019 11:53
@JvdV,, OP has wriiten I want to merge them comparing the dates, so that they get the Article number related to the date closest to but before the date in table 1.
Aug 19, 2019 11:51
@JvdV,, this is what OP written I tried regular VLOOKUP to merge on email, but can't really figure out if it's possible to do this conditionally. No where I found the Closest Match !!
Aug 19, 2019 11:47
Both are in context of Mail 2
Aug 19, 2019 11:46
@JvdV, also read comments in Col R,, both Red ,, one is Replaced & others is New
Aug 19, 2019 11:46
Aug 19, 2019 11:44
@JvdV, wait I'm now sending Screen Shot
Aug 19, 2019 11:40
@JvdV,, This ,, I've replaced 05/06/19 16:30 mail2 No 1 in Row 4 with 04/06/19 16:30 mail2 No 1 get the correct sequence and if is replaced with 04/06/19 16:30 mail2 No 0 then sequence is 1,0,7,6 nothing wrong!!
Aug 19, 2019 11:39
@JvdV, this one I've already used check my comment above of yours with link,,,
Aug 19, 2019 11:37
@JvdV, which link,,
Aug 19, 2019 11:36
@JvdV, I've added new Row at last Row S9 this one 04/06/19 6:30 mail2 No 0 and in Q2:Q5 I'm getting correct sequence 1,1,7,6,, did you know Y coz,, the Date 04/06/19 is smaller than Date 07/14/19 20:21 mail2 in Row O3.
Aug 19, 2019 11:36
I've replaced 05/06/19 16:30 mail2 No 1 in Row 4 with 04/06/19 16:30 mail2 No 1 get the correct sequence and if is replaced with 04/06/19 16:30 mail2 No 0 then sequence is 1,0,7,6 nothing wrong!!
Aug 19, 2019 11:36
@JvdV, my data has Date MM/DD/YY HH:MM,,
 
Aug 18, 2019 12:59
@JvdV, that's Y I've used both for the same data set to clear my view point.
Aug 18, 2019 12:58
@JvdV, and this is the point I've raised ,,, your formula showing correct result with the Answer you have posted,, but when I'm using produces wrong result,,
Aug 18, 2019 12:56
@JvdV,, the result I've got in **Q2:Q5** is using my recent Formula, and the result show in **W2:W5** I'm getting used by your formula,,
=INDEX($U$2:$U$8,MATCH(AGGREGATE(14,3,($T$2:$T$8=P2)*($S$2:$S$8<O2)*($S$2:$S$8),1),$S$2:$S$8,0)) .
Aug 18, 2019 12:16
@JvdV, check this same Cell references (Data Range) but 2 different results,, this happens sometimes,, I'm also trying to find the reason,,, you may also try to fix it,, ultimately we both get the reason ,, have nice day ☺
Aug 18, 2019 12:14
Aug 18, 2019 12:07
@JvdV, nothing wrong with your formula except, if & when cell references changes (like I've used for) returns wrong sequence instead of correct one 1,1,7,6. What formula I've used is working anywhere, even between sheets also,, but what would be better, wait for OP's response,, have nice chat with you ☺
Aug 18, 2019 10:43
@JvdV I've used simple array formula filter two Criteria ,,
Aug 18, 2019 10:41
@JvdV,, better we have to wait till OP's response !!
Aug 18, 2019 10:40
@JvdV,, for confirmation I've written Comment to the OP to add the expected output,, to match with ,,.'
Aug 18, 2019 10:35
@JvdV,, I've used different Formula and it's got Correct results,,
Aug 18, 2019 10:08
and I've used Date Time what You have entered!
Aug 18, 2019 10:07
Excel returns Numeric representation when one converts date column into Number!!
Aug 18, 2019 10:05
op's date 2019-07-07 06:49:10 & 02/04/2019 15:11
Aug 18, 2019 10:04
it doesn't matters since in both Col F & O I've same format mm/dd/yy Hh:MM
Aug 18, 2019 10:00
Look these are from Row 1 to 8,,, and getting error,, I've rewritten Date Time,, every set of data is True
Aug 18, 2019 09:59