+ Reply to Thread
Results 1 to 10 of 10

Help with my VBA Code

  1. #1
    Forum Contributor
    Join Date
    06-17-2014
    Location
    london
    MS-Off Ver
    365
    Posts
    398

    Help with my VBA Code

    Dear All

    I have managed to write the following code with the help from this forum. But I am stuck in one bit ad I am new to VBA and will appreciate your help.

    Basically, this code will look at my customers and if they have spent more than 1000 pounds and agreed to receive email and its been more than 30 days since their first purchase then the cell where their surname (column B) is will start flashing for two seconds and the date when I get the reminder is recorded in column J .

    When I run the code everything works fine and the dates are entered correctly, however the only cell that flashes in B5 even though cells B7 and B9 should flash as well since they meet my If criteria.

    I think the line Set myCell= .Cells(I, 2) is not working properly as it doesn't move on to the next cell to check whether it needs to flash or not.

    I have attached my code and any help is much appreciate it as I need the code to make all the cells that meet my criteria to flash rather than just the first one.

    Please Login or Register  to view this content.

  2. #2
    Registered User
    Join Date
    02-27-2014
    Location
    Range("A1")
    MS-Off Ver
    Excel 2007
    Posts
    24

    Re: Help with my VBA Code

    rv plz don't cross post, you posted this thread here and in www.mrexcelforum.com
    I'm glad you got it to work :-D
    ZAX

  3. #3
    Forum Contributor
    Join Date
    06-17-2014
    Location
    london
    MS-Off Ver
    365
    Posts
    398

    Re: Help with my VBA Code

    Hi

    Sorry if this was not allowed, I thought it is Ok as these seemed t be different forum.I just really need an urgent answer I am I need t complete this urgently for my work. I can remove the other post if this is not allowed.

  4. #4
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Help with my VBA Code

    Hi,

    Cross-posting is when you post the same question in other forums on the web. The last thing you want to do is waste people's time working on an issue you have already resolved elsewhere. We prefer that you not cross-post at all, but if you do (and it's unlikely to go unnoticed), you MUST provide a link (copy the url from the address bar in your browser) to the cross-post.

    Expect cross-posted questions without a link to be closed and a message will be posted by the moderator explaining why. We are here to help so help us to help you!

    Read this to understand why we ask you to do this, and then please edit your first post to include links to any and all cross-posts in any other forums (not just this site).
    Richard Buttrey

    RIP - d. 06/10/2022

    If any of the responses have helped then please consider rating them by clicking the small star icon below the post.

  5. #5
    Forum Contributor
    Join Date
    06-17-2014
    Location
    london
    MS-Off Ver
    365
    Posts
    398

    Re: Help with my VBA Code

    Thanks for this. I genuinely didn't realise this. I have posted this in other forums and the url are
    http://www.excelguru.ca/forums/forum...BA-Programming
    and also http://www.mrexcel.com/forum/excel-q...ions-code.html

    my intention was in no mean to waste anyone's time I just thought that it will help me to get an answer quicker. Sorry for any inconvenience but u really will appreciate any help on this . I am happy to remove the other posts

  6. #6
    Forum Expert Arkadi's Avatar
    Join Date
    02-13-2014
    Location
    Smiths Falls, Ontario, Canada
    MS-Off Ver
    Office 365
    Posts
    5,059
    The problem is that you need to reset x back to 0. X is already 2 after first time, so no flashing occurred for later loops
    Please help by:

    Marking threads as closed once your issue is resolved. How? The Thread Tools at the top
    Any reputation (*) points appreciated. Not just by me, but by all those helping, so if you found someone's input useful, please take a second to click the * at the bottom left to let them know

    There are 10 kinds of people in this world... those who understand binary, and those who don't.

  7. #7
    Forum Contributor
    Join Date
    06-17-2014
    Location
    london
    MS-Off Ver
    365
    Posts
    398

    Re: Help with my VBA Code

    thanks. Is there any way you can send me the line of the code so I can ideally add this to my code as I am am a novice in VBA

  8. #8
    Forum Contributor
    Join Date
    06-17-2014
    Location
    london
    MS-Off Ver
    365
    Posts
    398

    Re: Help with my VBA Code

    Just to say I managed to do this and it works fine. Thanks, I set x=0 before it starts again. The only question is that it is flashing one at the time, is there anyway I can change the code so that all the cells that meet the criteria to flash simultaneously? any help with the code and the actuall code will be appreciate it.I am nearly there

  9. #9
    Forum Expert Arkadi's Avatar
    Join Date
    02-13-2014
    Location
    Smiths Falls, Ontario, Canada
    MS-Off Ver
    Office 365
    Posts
    5,059

    Re: Help with my VBA Code

    Glad you did it on your own, I would have said pretty much what you did. I'm on my cell so can't solve the simultaneous thing now, but it is possible, with new code since you would have to check all cells in range, store those that meet criteria, and THEN flash. I'll look into it later or in the am.

  10. #10
    Forum Expert Arkadi's Avatar
    Join Date
    02-13-2014
    Location
    Smiths Falls, Ontario, Canada
    MS-Off Ver
    Office 365
    Posts
    5,059

    Re: Help with my VBA Code

    Hi rv02, about your flashing simultaneously... Try the code below... The date will update during the check, and so before flashing, but the cells will flash together....


    Please Login or Register  to view this content.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] VBA code for assigning a numeric code to text; then numeric code populates table
    By cteaster in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 05-14-2014, 08:01 PM
  2. Replies: 2
    Last Post: 12-17-2013, 11:51 AM
  3. Replies: 2
    Last Post: 03-09-2013, 04:30 AM
  4. Adding Text to another cell VB code (Help Tweeking code) (Excel 2007)
    By Excelnoub in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 12-06-2012, 11:37 AM
  5. Replies: 0
    Last Post: 10-06-2006, 09:05 AM

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