+ Reply to Thread
Results 1 to 12 of 12

Code check for highlight macro

  1. #1
    Forum Contributor
    Join Date
    12-16-2016
    Location
    Colorado, US
    MS-Off Ver
    2013
    Posts
    115

    Code check for highlight macro

    Hey Everyone for some reason im getting a next without a for error in the debug for this code:

    Please Login or Register  to view this content.
    I was trying to practice with some things I learned from on of the forum experts but im not sure why im getting this error (or if the variables I have set for cost will work) trying o have it search for currency values

    Thanks as always to those greater and wiser than I

    Fawkes_

  2. #2
    Forum Expert daffodil11's Avatar
    Join Date
    07-11-2013
    Location
    Phoenixville, PA
    MS-Off Ver
    MS Office 2016
    Posts
    4,465

    Re: Code check for highlight macro

    Your 4th If statement is missing an End If.
    Make Mom proud: Add to my reputation if I helped out!

    Make the Moderators happy: Mark the Thread as Solved if your question was answered!

  3. #3
    Forum Contributor
    Join Date
    12-16-2016
    Location
    Colorado, US
    MS-Off Ver
    2013
    Posts
    115

    Re: Code check for highlight macro

    Alright, totally missed that smh, one day ill stop missing the small stuff.

    I have once more question if anyone has a moment.

    Im trying to highlight anything that falls into the array red, which works, im trying to highlight any value between 5000 and 9999.99 as yellow it works, but when I add the portion to highlight any value over 10,000 as red it just highlights the entire sheet.



    Please Login or Register  to view this content.

  4. #4
    Forum Contributor
    Join Date
    12-16-2016
    Location
    Colorado, US
    MS-Off Ver
    2013
    Posts
    115

    Re: Code check for highlight macro

    Actually, I think the problem lies in the cost variables im setting, the column it is searching is using the output from an equation to make a currency value.

    and I don't know how to make my ranges work properly.

    I uploaded a template with an example of what im talking about anyone have any ideas?
    Attached Files Attached Files
    Last edited by Fawkes_; 02-08-2017 at 06:15 PM.

  5. #5
    Forum Contributor
    Join Date
    12-16-2016
    Location
    Colorado, US
    MS-Off Ver
    2013
    Posts
    115

    Re: Code check for highlight macro

    Update, I was trying a few different things as well.


    Please Login or Register  to view this content.
    All are failing, Anyone have any ideas?

  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

    Re: Code check for highlight macro

    Define the variables as double.... not string, then set their value without quotes. Also the arrray should not be strings. The column you are checking is numerical.
    Last edited by Arkadi; 02-09-2017 at 04:30 PM.
    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
    12-16-2016
    Location
    Colorado, US
    MS-Off Ver
    2013
    Posts
    115

    Re: Code check for highlight macro

    Which method would I use to set them?

    Please Login or Register  to view this content.

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

    Re: Code check for highlight macro

    Set is for objects like ranges, normal variables(string, double, long, integer, etc) don't use "Set" just "costY = 5000"

  9. #9
    Forum Contributor
    Join Date
    12-16-2016
    Location
    Colorado, US
    MS-Off Ver
    2013
    Posts
    115

    Re: Code check for highlight macro

    Lol, so simple.... you make it all look so easy my good man thank you as always

  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: Code check for highlight macro

    My pleasure to help you out my friend
    I must ask once again though .. If this is resolved please mark the thread as solved? It is important to keep the site running well that people help us with these details. Thanks

  11. #11
    Forum Contributor
    Join Date
    12-16-2016
    Location
    Colorado, US
    MS-Off Ver
    2013
    Posts
    115
    Quote Originally Posted by Arkadi View Post
    My pleasure to help you out my friend
    I must ask once again though .. If this is resolved please mark the thread as solved? It is important to keep the site running well that people help us with these details. Thanks

    Sorry, the site tripped out after my last post to you and I couldn't get logged in again to close it. 🤦*♂️ is there a way to close if on mobile?

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

    Re: Code check for highlight macro

    Yeah there have been some issues, it is being worked on as far as I know.

    Thanks for taking care of it
    Not sure about the mobile... unless you change the theme from mobile to regular (option at the bottom when viewing on mobile)

+ 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. How to check if excel file is Checked Out in SharePoing Check Out, run code, Check In
    By jrtraylor in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 01-08-2016, 04:36 PM
  2. I need Macro(VBA code) to Highlight Invalid Country Codes in a column
    By narendrabr in forum Excel Programming / VBA / Macros
    Replies: 16
    Last Post: 08-31-2012, 07:01 AM
  3. I need Macro(VBA code) to Highlight Invalid Country Codes in a column
    By narendrabr in forum Hello..Introduce yourself
    Replies: 1
    Last Post: 08-27-2012, 12:16 PM
  4. vba code/macro to check checkboxes
    By Jzon758 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 08-02-2012, 02:55 PM
  5. Macro code to highlight each row when you click on them
    By robertguy in forum Excel General
    Replies: 2
    Last Post: 10-21-2011, 11:30 AM
  6. Macro or VBA code to highlight specific named columns in a column chart
    By glenp99 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 03-03-2010, 05:12 AM
  7. Macro to check data from 2 columns and highlight data
    By zybatu01 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 11-04-2008, 08:14 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