Doc Sir this code has issue when i ran with 200 stocks it is doing incorrect work
So it's my request u plz remake the code for the same Doc Sir ignore this vba code
the condition written in vba language has some errors
Doc Sir this code has issue when i ran with 200 stocks it is doing incorrect work
So it's my request u plz remake the code for the same Doc Sir ignore this vba code
the condition written in vba language has some errors
I see no problem with the macro from dangelor
So if I write a new macro it may also give the same error. My macro would be very similar to that for dangelor. So most likely it will also error.
Your last screenshots are useless. They tell me nothing.
I do not understand what you are showing me with the screenshots. I do not understand what error you are showing.
Try to make and upload a small file with also row data that errors.
Explain again and show me what and where the errors are….
….If you are my competitor, I will try all I can to beat you. But if I do, I will not belittle you. I will Salute you, because without you, I am nothing.
If you are my enemy, we will try to kick the fucking shit out of you…..
Winston Churchill, 1939
Save your Forum..._
_...KILL A MODERATOR!!
Sure Doc Sir i have atttached the sample file plz run the macro and see the output Doc Sir
and plz convert alert.xlsx to alert..csv (bcoz i was not able to upload csv so i converted the file to xlsx so plz convert it into csv and then run the macro Doc Sir)
The problem is that you are matching an empty cell
See here:- http://www.excelfox.com/forum/showth...ll=1#post13133
So what do you want to do if call in column I is empty??
Cell I41 is Empty:
Worksheet: 1-Sheet1 27Apr_2
Row\Col A B C D E F G H I J K L 38NSE CONCOR EQ 368 376.6 359.5 367.8 361.1 4749 3.611 3647 364.711 39NSE CUMMINSIND EQ 420.95 426.55 377.25 419.15 384.95 1901 3.8495 38875 388.7995 40NSE DABUR EQ 499 503.75 494.5 499 499.05 772 4.9905 4941 494.0595 41NSE DISHTV EQ 5.1 5.15 4.75 4.95 4.75Empty 0.0475 475 4.7975 42NSE DIVISLAB EQ 2410 2460 2390.6 2417.3 2425.4 10940 24.254 240115 2401.146 43NSE DLF EQ 135 135 127.6 137 128.2 14732 1.282 12945 129.482 44NSE DRREDDY EQ 4010 4049.6 3970.1 4027.1 4002.8 881 40.028 40428 4042.828
Last edited by DocAElstein; 04-26-2020 at 06:35 PM.
….If you are my competitor, I will try all I can to beat you. But if I do, I will not belittle you. I will Salute you, because without you, I am nothing.
If you are my enemy, we will try to kick the fucking shit out of you…..
Winston Churchill, 1939
Save your Forum..._
_...KILL A MODERATOR!!
do nothing for empty cell Doc Sir
Column Letter I is column number 9
So
ORCode:For i = 2 To rg1.Rows.Count If .Cells(i, 8) > .Cells(i, 4) Then ' if column H of 1.xls is greater than column D of 1.xls If Not .Cells(i, 9).Value = "" Then Set c = Ws2.Columns(2).Find(.Cells(i, 9)) ' match column I of 1.xls with column B of 2.csv If Not c Is Nothing Then 'if match found c.Offset(, 2).Value = "<" ' put this symbol "<" in column D of 2 c.Offset(, 3).Value = .Cells(i, 11) ' copy paste the data of column K of 1.xls in column E of 2.csv End If Else ' if column H of 1.xls is lower than column D of 1.xls If Not .Cells(i, 9).Value = "" Then Set c = Ws2.Columns(2).Find(.Cells(i, 9)) ' match column I of 1.xls with column B of 2.csv If Not c Is Nothing Then 'if match found c.Offset(, 2).Value = ">" ' then put this symbol ">" in column D of 2.csv c.Offset(, 3).Value = .Cells(i, 11) ' copy paste the data of column K of 1.xls in column E of 2.csv End If End If Next i
Code:For i = 2 To rg1.Rows.Count If .Cells(i, 8) > .Cells(i, 4) Then ' if column H of 1.xls is greater than column D of 1.xls If .Cells(i, 9).Value = "" Then ' do nothing Else Set c = Ws2.Columns(2).Find(.Cells(i, 9)) ' match column I of 1.xls with column B of 2.csv If Not c Is Nothing Then 'if match found c.Offset(, 2).Value = "<" ' put this symbol "<" in column D of 2 c.Offset(, 3).Value = .Cells(i, 11) ' copy paste the data of column K of 1.xls in column E of 2.csv End If End If Else ' if column H of 1.xls is lower than column D of 1.xls If .Cells(i, 9).Value = "" Then ' do nothing Else Set c = Ws2.Columns(2).Find(.Cells(i, 9)) ' match column I of 1.xls with column B of 2.csv If Not c Is Nothing Then 'if match found c.Offset(, 2).Value = ">" ' then put this symbol ">" in column D of 2.csv c.Offset(, 3).Value = .Cells(i, 11) ' copy paste the data of column K of 1.xls in column E of 2.csv End If End If End If Next i
Last edited by DocAElstein; 04-26-2020 at 06:53 PM.
….If you are my competitor, I will try all I can to beat you. But if I do, I will not belittle you. I will Salute you, because without you, I am nothing.
If you are my enemy, we will try to kick the fucking shit out of you…..
Winston Churchill, 1939
Save your Forum..._
_...KILL A MODERATOR!!
Doc Sir code is not proper, its my fault (i was not able to explained u [misunderstanding ]) let me explain
there are some datas who has a match but it was not matched by the vba code
i am attaching a sample pic of the same (there are many more matches i have attached only two sample pic)
error1 it has a match plz see but the vba code doesnt matches the same
error2 it has a match plz see but the vba code doesnt matches the same
there are many more data who has a match
Upload file with small number of rows < 30 , to demonstrate all remaining problems
Explain what rows are not working
Last time to tell you : In forum test data just enough rows to show all problems!!!
I showed you:- http://www.excelfox.com/forum/showth...ll=1#post13133
Take your time and do it right. I am busy now until later...
….If you are my competitor, I will try all I can to beat you. But if I do, I will not belittle you. I will Salute you, because without you, I am nothing.
If you are my enemy, we will try to kick the fucking shit out of you…..
Winston Churchill, 1939
Save your Forum..._
_...KILL A MODERATOR!!
Doc Sir i checked all the details No Doubt code has issue
i tried changing i=1 also but after that also i am not getting correct output
this code is working perfect with small data file but with the file which i sented u of 200 stocks it is not working
if i share less data file then it will show correct result and again u will tell me the code is perfect but with the file which i sented u its not working plz run the macro and see only the cells that doesnt has data and check the same in 1.xls it is there or not u will see it is there then question arises why the data is not pasted plz ran the macro and see it
You are right
OK, now see what the problem is.
The macro is bad
You are right, forget the macro, it is a bad macro. There are many wrong values
Now I am busy, but tomorrow I will write you a new macro
Alan
….If you are my competitor, I will try all I can to beat you. But if I do, I will not belittle you. I will Salute you, because without you, I am nothing.
If you are my enemy, we will try to kick the fucking shit out of you…..
Winston Churchill, 1939
Save your Forum..._
_...KILL A MODERATOR!!
Bookmarks