+ Reply to Thread
Results 1 to 7 of 7

Macro is cycling

  1. #1
    Registered User
    Join Date
    06-30-2011
    Location
    California
    MS-Off Ver
    Excel 2003
    Posts
    4

    Macro is cycling

    Hello everyone.

    I'm having problems with a code on a macro.

    I get a bar code with a bar code scanner and automatically fills a cell on excel. So if a bar code has a "n" number it will fill the cell with color and make a beep. Everything is good but the beep it seems to be cycling and it beeps whatever the cells value is after the first beep.

    Please Login or Register  to view this content.
    hope some one can help me.

    thanks
    Last edited by robfet; 06-30-2011 at 12:28 PM. Reason: change title and code

  2. #2
    Forum Guru MarvinP's Avatar
    Join Date
    07-23-2010
    Location
    Woodinville, WA
    MS-Off Ver
    Office 365
    Posts
    16,169

    Re: Macro doesn't works!

    Hi robfet and welcome to the forum,

    You should first click on the Green EDIT button below your post and then click on the "Go Advanced" below the message area. Then select the text that is code and click on the "#" Icon above the message area to put code tags around your code. This will then follow the rules of the forum and make your code easier for us to deal with.

    It looks like your code will see if there is a cell value of 32884173068 anywhere in Column A (down to row 1000) whenever anything on the worksheet changes. I don't think that is what you want.

    You need to learn this line of code to be more efficenent:

    Please Login or Register  to view this content.
    see http://www.ozgrid.com/VBA/vba-intersect.htm
    One test is worth a thousand opinions.
    Click the * Add Reputation below to say thanks.

  3. #3
    Registered User
    Join Date
    06-30-2011
    Location
    California
    MS-Off Ver
    Excel 2003
    Posts
    4

    Re: Macro is cycling

    Thanks Marvin.

    I saw many examples of intersect method. So what you advise me is to use that method, but i'm getting confused about how to place the code where if a number is typed on a cell fill it with a color. :s then beep.... I tried many ways but it doesn't run because of errors....

  4. #4
    Forum Expert snb's Avatar
    Join Date
    05-09-2010
    Location
    VBA
    MS-Off Ver
    Redhat
    Posts
    5,649

    Re: Macro is cycling

    I think this suffices:

    Please Login or Register  to view this content.



  5. #5
    Registered User
    Join Date
    06-30-2011
    Location
    California
    MS-Off Ver
    Excel 2003
    Posts
    4

    Re: Macro is cycling

    snb,

    when the first 32884173068 number is typed it works fine, it beeps and the cell get the color but when another number is typed, different to 32884173068 the cells turns to color red too, it doesn't beep but the color changed.....

  6. #6
    Forum Expert snb's Avatar
    Join Date
    05-09-2010
    Location
    VBA
    MS-Off Ver
    Redhat
    Posts
    5,649

    Re: Macro is cycling

    Please, post your example workbook in which this happens here.

  7. #7
    Registered User
    Join Date
    06-30-2011
    Location
    California
    MS-Off Ver
    Excel 2003
    Posts
    4

    Re: Macro is cycling

    I changed the code... now its working

    Please Login or Register  to view this content.
    Why I need this to work? We need to scan bar-codes from boxes, so we need to make sure if is the same bar code and if is not make a warning with this sound and color cell.

    Is there a way to clear and stay in the same cell? We need to scan over 15,000 boxes so every time the scanner got a bar code pass it to the next cell. So I'm wondering if its possible to clear the cell value after the bar code has been scanned and then stay in that same cell waiting to another bar code?
    Last edited by robfet; 07-07-2011 at 08:18 PM.

+ 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