itjockey79
asked on
Data Generator V3
Hi Experts,
Need change in VBA as it cut past data from sheet EOD to respective symbol by clicking (Ctrl+o).but problem arise when for the same date i run this macro twice or may be more it add line to symbol sheet for same date not over pasting on same date.& if it is possible in EOD sheet when i run macro then all data is disappear i want at name column data so i can link data from other sheet by using vlookup function.
pls see attached file....
Thank You
EOD-V3.xlsm
Need change in VBA as it cut past data from sheet EOD to respective symbol by clicking (Ctrl+o).but problem arise when for the same date i run this macro twice or may be more it add line to symbol sheet for same date not over pasting on same date.& if it is possible in EOD sheet when i run macro then all data is disappear i want at name column data so i can link data from other sheet by using vlookup function.
pls see attached file....
Thank You
EOD-V3.xlsm
ASKER
yes in header in EOD always Name date open high low close volume want to header always be there but also name column data,as i can link rest data by vlookup & new data on same date should be over past on respective sheet,
pls provide file dont wana to spoil code while pasting in VBA screen...
Thank You
pls provide file dont wana to spoil code while pasting in VBA screen...
Thank You
itjockey79,
Please see attached. The second "EOD" was just for testing. BTW, do you mean to have all the blank rows at the end of each sheet?
dont wana to spoil code while pasting in VBA screen...
?!
Regards,
Brian.EOD-V3B.xlsm
Please see attached. The second "EOD" was just for testing. BTW, do you mean to have all the blank rows at the end of each sheet?
dont wana to spoil code while pasting in VBA screen...
?!
Regards,
Brian.EOD-V3B.xlsm
ASKER
itjockey79,
Please confirm...
(1) If an entry already exists for a company for the date then the old entry should be overwritten. (Apologies, I missed this in your original request.)
(2) On the EOD sheet, you mention "step 1 :- this shud remain after code run." I can't find any way to repeat this - no matter what data I use, the name is always left behind.
Thanks,
Brian.
Please confirm...
(1) If an entry already exists for a company for the date then the old entry should be overwritten. (Apologies, I missed this in your original request.)
(2) On the EOD sheet, you mention "step 1 :- this shud remain after code run." I can't find any way to repeat this - no matter what data I use, the name is always left behind.
Thanks,
Brian.
ASKER
yes step1
step 2 it is ok if names not remain bcoz if code run then formula also wiped out,so no need to remain name but you can see in my 1 attached sheet there is one more thing if any new entry comes which is not in symbol sheet then it creates new sheet for that name so pls let that process remain same.for data i used one more sheet which is BB & i had recorded macro to copy past on EOD then i run (Ctrl+o) .no step 2 4got it but be sure sir if any new entry come then create new sheet for that entry.
step 2 it is ok if names not remain bcoz if code run then formula also wiped out,so no need to remain name but you can see in my 1 attached sheet there is one more thing if any new entry comes which is not in symbol sheet then it creates new sheet for that name so pls let that process remain same.for data i used one more sheet which is BB & i had recorded macro to copy past on EOD then i run (Ctrl+o) .no step 2 4got it but be sure sir if any new entry come then create new sheet for that entry.
itjockey79,
(1) "yes step1"
Thanks.
(2) "it is ok if names not remain"
I've tried but no matter what I do the Names always remain. How are you getting rid of them?
(3) "it creates new sheet for that name"
That code is working fine for me. Is it not working for you?
(4) "if any new entry come then create new sheet for that entry"
Sure, but I'll hold off until I've got your answers to (3) and (4).
Thanks,
Brian.
(1) "yes step1"
Thanks.
(2) "it is ok if names not remain"
I've tried but no matter what I do the Names always remain. How are you getting rid of them?
(3) "it creates new sheet for that name"
That code is working fine for me. Is it not working for you?
(4) "if any new entry come then create new sheet for that entry"
Sure, but I'll hold off until I've got your answers to (3) and (4).
Thanks,
Brian.
ASKER
yes create new sheet if new symbol is there is in eOD sheet
i am not talking about Name as header it is remain i am concern about name column i.e ACC LTD ,L&T .....& so on but that requirement is not need it
now only just data over paste on same date & new sheet creation if new symbol is there in EOD sheet i.e current 51 symbol but if new 5 symbol added new sheet created of that name
i am not talking about Name as header it is remain i am concern about name column i.e ACC LTD ,L&T .....& so on but that requirement is not need it
now only just data over paste on same date & new sheet creation if new symbol is there in EOD sheet i.e current 51 symbol but if new 5 symbol added new sheet created of that name
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
please update
'-- move data to appropriate sheet
'-- restrict data insertion to A23:F1500
dst.Range("A23:F1499").Copy dst.Range("A24:F1500")
src.Range("B" & row.row & ":G" & row.row).Copy dst.Range("A" & 23)
to '-- move data to appropriate sheet
'-- restrict data insertion to A23:F1500
dim result as range
Set result = dst.Range("A:A").Find(what:=src.Range("B" & row.row))
If result Is Nothing Then
'-- if entry with same date cannot be found,
'-- insert new row restrict data insertion to A23:F1500
dst.Range("A23:F1499").Copy dst.Range("A24:F1500")
src.Range("B" & row.row & ":G" & row.row).Copy dst.Range("A" & 23)
Else
'-- otherwise, overwrite the line
src.Range("B" & row.row & ":G" & row.row).Copy dst.Range("A" & result.row)
End If
Hi, akoster.
Your code appears to handle duplicate dates in a similar way to mine, but doesn't include the other functionality that the OP requested. I'm not sure what it brings to the party!
Regards,
Brian.
Your code appears to handle duplicate dates in a similar way to mine, but doesn't include the other functionality that the OP requested. I'm not sure what it brings to the party!
Regards,
Brian.
ASKER
Thank You
Thanks, itjockey79.
Please see the code below. It assumes that there will be a header row on the EOD sheet. Please let me know if this is not always the case.
Open in new window
Regards,Brian.