+ Reply to Thread
Results 1 to 21 of 21

Get rid of repeating data

  1. #1
    Registered User
    Join Date
    03-05-2012
    Location
    Vienna
    MS-Off Ver
    Excel 2003
    Posts
    11

    Get rid of repeating data

    Hi,

    My issue is as follows:

    I have a table of data in which I have several columns. In one of them there is an in formation about percentage price change from the beggining of the day until this moment in the cell. In the other Column there is an information if we shoul or shouldnt sell the item- 'Sell' or 0. The item should be sold just once a day but now it's sold every half an hour when it reaches particular price. This action shouln't Be repeated during the day, so after first time when the formula is active it should stop until the next day.


    If the difference between Open of the day and High of the half an hour is more than half a percent it sells. But it shoul do it only once a day as i already told.

    Sorry if I couldn't quite explain what a problem is, but I could upload the file so far as it weights about 25 mb.

  2. #2
    Forum Contributor
    Join Date
    02-07-2012
    Location
    MIA
    MS-Off Ver
    Excel 2007, 2010
    Posts
    429

    Re: Get rid of repeating data

    Could you upload just a sample instead of the whole file, with dummy data?

  3. #3
    Registered User
    Join Date
    03-05-2012
    Location
    Vienna
    MS-Off Ver
    Excel 2003
    Posts
    11

    Re: Get rid of repeating data

    Here.
    For example cells K25 and K26. And I have the whole year 2010 of the half an hour data.

    The sell order goes when rize in the open price of the day until high price of the half an hour is more thatn half a percent.

    Tank you!!Example for forum.xls
    Last edited by danielalmaty; 03-05-2012 at 10:51 AM.

  4. #4
    Registered User
    Join Date
    03-05-2012
    Location
    Vienna
    MS-Off Ver
    Excel 2003
    Posts
    11

    Re: Get rid of repeating data

    Guys, I urgently need help. If anyone of you will be able to help me, it would be perfect!!

  5. #5
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,167

    Re: Get rid of repeating data

    Could you explain the issue you are facing? I understood how SELL n 0 are calculated.
    If I have helped, Don't forget to add to my reputation (click on the star below the post)
    Don't forget to mark threads as "Solved" (Thread Tools->Mark thread as Solved)
    Use code tags when posting your VBA code: [code] Your code here [/code]

  6. #6
    Registered User
    Join Date
    03-05-2012
    Location
    Vienna
    MS-Off Ver
    Excel 2003
    Posts
    11

    Re: Get rid of repeating data

    So, the issue is that "Sell" action should happen just once a day. But it happens every half an hour if the difference between open price of the day and highest price of this half an hour is more that half a percent. Sell action shold be activated just the very first time and then be inactive until the next day begins.

  7. #7
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,167

    Re: Get rid of repeating data

    So what should be displayed if another "Sell" occurs?

  8. #8
    Registered User
    Join Date
    03-05-2012
    Location
    Vienna
    MS-Off Ver
    Excel 2003
    Posts
    11

    Re: Get rid of repeating data

    Another Sell just shouldn't occur this day. It should be 0 in all the following half hour periods until the next day starts and everything starts from the beggining.

  9. #9
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,167

    Re: Get rid of repeating data

    Try running this code.
    Please Login or Register  to view this content.

  10. #10
    Registered User
    Join Date
    03-05-2012
    Location
    Vienna
    MS-Off Ver
    Excel 2003
    Posts
    11

    Re: Get rid of repeating data

    Sorry, I didn't quite get where should I write in this code.

  11. #11
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,167

    Re: Get rid of repeating data

    On your excel file, press Alt+F11, it will open up a code window. On the left hand side, right click on microsoft excel objects. Select Insert->Module. Copy the code over. Go back to your excel file. Go to Tools->Macro->Macros and run the macro given.

  12. #12
    Registered User
    Join Date
    03-05-2012
    Location
    Vienna
    MS-Off Ver
    Excel 2003
    Posts
    11

    Re: Get rid of repeating data

    Thank you it worked out in the demo file I've sent, but the file I need, which contains 16000 lines of information just stuck with this code. I tried to wait 15 minutes but nothing changes. I couldn't upload the original file here because it is 25 mb.

  13. #13
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,167

    Re: Get rid of repeating data

    Is your original file and the demo file the same in layout and columns?

  14. #14
    Registered User
    Join Date
    03-05-2012
    Location
    Vienna
    MS-Off Ver
    Excel 2003
    Posts
    11

    Re: Get rid of repeating data

    No, it's much bigger and there are much more columns and other details.

  15. #15
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,167

    Re: Get rid of repeating data

    In that case, your demo file should have reflected all the columns. Can you tell me which is your last column and which column has the "SELL" data in it.

    It will be good if you post another sample with the same columns as your original file.

  16. #16
    Registered User
    Join Date
    03-05-2012
    Location
    Vienna
    MS-Off Ver
    Excel 2003
    Posts
    11

    Re: Get rid of repeating data

    Sell column is placed in K. And Last column is Y. But I also thre other worksheets in the same excel file, whhich are interconnected, if it makes difference.

    I decided to upload the whole file. Here is the link: http://www.box.com/s/pu1orimly6xtap6bqac5

  17. #17
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,167

    Re: Get rid of repeating data

    Made a few adjustments to the code - try this -
    Please Login or Register  to view this content.
    Last edited by arlu1201; 03-06-2012 at 10:17 AM.

  18. #18
    Registered User
    Join Date
    03-05-2012
    Location
    Vienna
    MS-Off Ver
    Excel 2003
    Posts
    11

    Re: Get rid of repeating data

    Thank you for your help!! Still, it just stucks when I try to run the macros. Probably it's too much information for my poor PC.

  19. #19
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,167

    Re: Get rid of repeating data

    Yeah, its taking time because your file is linked to another file. I have made a few adjustments in the above code. I ran it and it took a few seconds only. Try it and let me know.

  20. #20
    Registered User
    Join Date
    03-05-2012
    Location
    Vienna
    MS-Off Ver
    Excel 2003
    Posts
    11

    Re: Get rid of repeating data

    Nope. It's not starti to wok for 10 mnutes already.

  21. #21
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,167

    Re: Get rid of repeating data

    Hmm....are you getting any security warning at the top of your screen? If yes, click on Options -> Enable this content -> Ok -> Continue.

    Another question - there is a file linked to your workbook. Is it open along with this file that you are using? You need to ensure its open.

    If you do not need this linked file for your current worksheet, then copy the data from this sheet - SELL AudNzd to another blank workbook and run the code on it. Then you can copy back the results.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1